Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10979 closed enhancement (fixed)

Allow dynamic variables to be used in a report title and description

Reported by: Ryan J Ollos <ryan.j.ollos@…> Owned by: Ryan J Ollos <ryan.j.ollos@…>
Priority: normal Milestone: 1.1.1
Component: report system Version:
Severity: normal Keywords: bitesized
Cc: Branch:
Release Notes:

Dynamic variables can be used in the report title and description.

API Changes:

New function sub_vars in trac.util.text for substituting $XYZ-style variables in a string.

Internal Changes:

Description (last modified by Ryan J Ollos <ryan.j.ollos@…>)

It would be useful to be able to use dynamic variables in the report title and description. Some use cases for this were discussed in th:#10488. Here are some examples of how it could be used in the title:

  • Tickets for $COMPONENT
  • $STATUS tickets for milestone $MILESTONE
  • Tickets for $USER

Attachments (3)

t10979-r11481-1.patch (8.6 KB ) - added by Ryan J Ollos <ryan.j.ollos@…> 12 years ago.
Patch against r11481 of the trunk.
t10979-r11481-2.patch (9.7 KB ) - added by Ryan J Ollos <ryan.j.ollos@…> 12 years ago.
Patch against r11481 of the trunk.
t10979-r11481-3.patch (9.8 KB ) - added by Ryan J Ollos <ryan.j.ollos@…> 12 years ago.
Patch against r11481 of the trunk.

Download all attachments as: .zip

Change History (15)

comment:1 by Remy Blank, 12 years ago

Keywords: bitesized added
Milestone: next-dev-1.1.x

Sounds like a good idea.

comment:2 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Description: modified (diff)

by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Attachment: t10979-r11481-1.patch added

Patch against r11481 of the trunk.

comment:3 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Here is a patch that implements the feature. I took the opportunity to also add license headers to all of the modified files that were lacking them.

comment:4 by Remy Blank, 12 years ago

Owner: set to Remy Blank
Status: newassigned

Looks good. Could you please move the variable-substitution function and the corresponding regexp into trac.util.text? I'm sure we can re-use this.

Last edited 12 years ago by Remy Blank (previous) (diff)

in reply to:  4 comment:5 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Replying to rblank:

Looks good. Could you please move the variable-substitution function and the corresponding regexp into trac.util.text?

Sure, thanks for the review. I'll refresh the patch shortly.

by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Attachment: t10979-r11481-2.patch added

Patch against r11481 of the trunk.

comment:6 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Here is the refreshed patch. I'll follow up quickly if you spot any other changes that should be made.

comment:7 by Remy Blank, 12 years ago

Nitpick: please move the re.compile() out of the function and store it in a global _sub_vars_re variable.

by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Attachment: t10979-r11481-3.patch added

Patch against r11481 of the trunk.

comment:8 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

Done in latest patch. I positioned the variable just above the function in which it was used since I saw the same done elsewhere in the file.

After this is committed, I'll add a line or two to TracReports#AdvancedReports:DynamicVariables in order to document the feature.

comment:9 by Remy Blank, 12 years ago

Milestone: next-dev-1.1.x1.1.1

comment:10 by Remy Blank, 12 years ago

Owner: changed from Remy Blank to Ryan J Ollos <ryan.j.ollos@…>

Slightly modified patch applied in [11533] (made sub_vars_re public and used it in the report code, and URL-quoted the values in go_to_report()).

Ryan, I'm reassigning this to you to update TracReports and to add the "Release Notes" field in this ticket. Please close when this is done.

comment:11 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

API Changes: modified (diff)
Description: modified (diff)
Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks! TracReports has been updated.

comment:12 by Ryan J Ollos <ryan.j.ollos@…>, 12 years ago

I didn't mention the new tester.go_to_report method in the API Changes, but if that should be done just let me know.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos <ryan.j.ollos@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos <ryan.j.ollos@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.