Opened 3 years ago

Closed 3 years ago

# Use PageTickets macro outside of Wiki pages

Reported by: Owned by: Marcel Gestewitz lucid normal PageTicketsMacro normal

### Description

This useful macro is also of interest within ticket description text.

For me it works to apply the regular expression to formatter.source instead of finding own WikiPage and applying it on its text:

tickets = PageTicketsMacro.tickets_re.findall(formatter.source)


### comment:1 Changed 3 years ago by clemens

Hello

For me it is a very attractive proposal to make the PageTicket macro usable not only in wiki-pages but also in tickets. It perfectly matches my question on the trac-users@googlegroups.com mailing list:

On 11.12.2018 22:22, Clemens wrote:

Hello

How can one display a list of all ticket numbers which are mentioned in the current ticket (i.e. in description text, ticket comments, ticket fields and ticket custom fields)?

It might be something like the TicketQuery macro, but it shall work only on the current ticket, instead on all tickets.

Background: Relations between tickets are important. If for example the user views ticket X, then he or she may also want to know about related tickets Y and Z. The related tickets are mentioned somewhere deep in the long description text of the current ticket. Now the user likes to see a distilled list of all mentioned tickets. Once again please note that I am talking about data extraction within the same ticket, not globally across all tickets.

I am aware of the PageTicketsMacro. Unfortunately the PageTicketsMacro does not work on tickets, only on wiki pages. Otherwise it is more or less what I want.

Marcel's proposal would overcome this restriction. This would be great.

P.S.
I also want to highlight the new MentionedTicketsPlugin.

### comment:2 follow-up:  3 Changed 3 years ago by anonymous

Interesting. Is formatter.source always the entire wikipage text?

### comment:3 in reply to:  2 Changed 3 years ago by Marcel Gestewitz

Interesting. Is formatter.source always the entire wikipage text?

I've tested this before ticket creation and I did not found any restriction. But I am not sure if I missed something.

Similar to parsing the Wiki text, macros are not expanded. For example no tickets will be found if you use a TicketQuery somewhere on Wiki page. For this case I would like to enter further tickets directly in PageTickets macro (see #13525).

### comment:4 Changed 3 years ago by lucid

Resolution: → fixed new → closed

In 17328:

PageTicketsMacro: Allow using macro outside of wiki pages (fix #13523)

### comment:5 Changed 3 years ago by lucid

Thanks for the suggestion!

### Modify Ticket

Change Properties