Modify

Opened 8 months ago

Closed 7 months ago

Last modified 7 months ago

#13523 closed enhancement (fixed)

Use PageTickets macro outside of Wiki pages

Reported by: Marcel Gestewitz Owned by: lucid
Priority: normal Component: PageTicketsMacro
Severity: normal Keywords:
Cc: Trac Release:

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)

Attachments (0)

Change History (5)

comment:1 Changed 8 months 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 Changed 8 months ago by anonymous

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

comment:3 in reply to:  2 Changed 8 months ago by Marcel Gestewitz

Replying to anonymous:

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 7 months ago by lucid

Resolution: fixed
Status: newclosed

In 17328:

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

comment:5 Changed 7 months ago by lucid

Thanks for the suggestion!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain lucid.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.