Edgewall Software
Modify

Ticket #8069 (reopened enhancement)

Opened 3 years ago

Last modified 2 months ago

[PATCH] Support list of users as options list in ticket custom field

Reported by: Zachary Bedell <zbedell@…> Owned by:
Priority: normal Milestone: unscheduled
Component: ticket system Version: 0.11.3
Severity: normal Keywords: patch ticket custom field
Cc: jhn@…, andrew.c.martin@…
Release Notes:
API Changes:

Description

In the process of migrating from a Borland StarTeam? install to Trac+SVN, I needed the ability to assign multiple users to a ticket. Borland provided the ability to include custom Change Request fields which could be limited to the list of valid users within the StarTeam? project.

Attached is a patch which implements similar behavior in Trac. The patch introduces a simple variable replacement scheme to the options attribute of a custom ticket field. The INI section looks like this:

[ticket-custom]
devtest_assigned = select
devtest_assigned.label = Dev Tester Assigned
devtest_assigned.options = $userlist

Code in ticket/api.py checks for a select custom field which has an options attribute of literally "$userlist". If such a field is found, the field is passed to the existing function eventually_restrict_owner() to insert the listing of valid users.

The attached trivial three-line patch appears to work well against Trac-0.11.3.

Attachments

ticket custom user list-trac0.11.3.patch (709 bytes) - added by Zachary Bedell <zbedell@…> 3 years ago.
patch which implements this enhancement request
ticket_custom_user_list-trac0.12.dev.patch (794 bytes) - added by Andrew C Martin <andrew.c.martin@…> 2 months ago.
patch for trac 0.12-stable

Download all attachments as: .zip

Change History

Changed 3 years ago by Zachary Bedell <zbedell@…>

patch which implements this enhancement request

comment:1 Changed 3 years ago by cboos

  • Resolution set to duplicate
  • Status changed from new to closed

See #2662.

comment:2 Changed 2 years ago by ismael@…

The resolution is wrong, #2662 ticket is talking about something different.

This is not spam

comment:3 follow-up: Changed 19 months ago by rblank

  • Milestone set to unscheduled
  • Resolution duplicate deleted
  • Status changed from closed to reopened

This ticket is indeed not a duplicate of #2662. Maybe the reference was wrong?

comment:4 follow-up: Changed 19 months ago by jatyap <jatyap@…>

attached patch does not work well with 0.12. Will a patch for 0.12 be released?

comment:5 in reply to: ↑ 3 Changed 19 months ago by cboos

  • Keywords patch custom field added; patch, custom, removed

Replying to rblank:

Maybe the reference was wrong?

No, this was an attempt of consolidating slightly different ways to approach the "multiple users assigned to a ticket" feature, which was also the starting point for this ticket according to the description.

See ticket:2662#comment:27 (this is one of the interests of the "timeline" links, as that comment was done right after comment:1 ;-) ).

Note that solution suggested in this ticket is also related to dynamic fields (#4374 and #4549).

comment:6 Changed 14 months ago by jhn@…

  • Cc jhn@… added

Changed 2 months ago by Andrew C Martin <andrew.c.martin@…>

patch for trac 0.12-stable

comment:7 in reply to: ↑ 4 Changed 2 months ago by Andrew C Martin <andrew.c.martin@…>

  • Cc andrew.c.martin@… added
  • Summary changed from Support list of users as options list in ticket custom field [patch included] to [PATCH] Support list of users as options list in ticket custom field

Replying to jatyap <jatyap@…>:

attached patch does not work well with 0.12. Will a patch for 0.12 be released?

I've posted attachment:ticket_custom_user_list-trac0.12.dev.patch, which performs the same functionality as the original patch included with this ticket.

One issue to note: in both patches if a user logs in to trac for the first time ever, the custom fields which use the $userlist macro will not be updated until trac is restarted. I assume this is related to the @cached method decorator on def custom_fields.

Updated ticket summary with "[PATCH]" convention...

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from (none). Next status will be 'new'
Author


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

 
Note: See TracTickets for help on using tickets.