Edgewall Software
Modify

Opened 15 years ago

Last modified 3 years ago

#8069 new enhancement

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

Reported by: Zachary Bedell <zbedell@…> Owned by:
Priority: normal Milestone: next-dev-1.7.x
Component: ticket system Version: 0.11.3
Severity: normal Keywords: patch ticket custom field
Cc: jhn@…, andrew.c.martin@…, massimo.b@…, walty8@… Branch:
Release Notes:
API Changes:
Internal 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 (2)

ticket custom user list-trac0.11.3.patch (709 bytes ) - added by Zachary Bedell <zbedell@…> 15 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@…> 12 years ago.
patch for trac 0.12-stable

Download all attachments as: .zip

Change History (20)

by Zachary Bedell <zbedell@…>, 15 years ago

patch which implements this enhancement request

comment:1 by Christian Boos, 15 years ago

Resolution: duplicate
Status: newclosed

See #2662.

comment:2 by ismael@…, 14 years ago

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

This is not spam

comment:3 by Remy Blank, 14 years ago

Milestone: unscheduled
Resolution: duplicate
Status: closedreopened

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

comment:4 by jatyap <jatyap@…>, 14 years ago

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

in reply to:  3 comment:5 by Christian Boos, 14 years ago

Keywords: field added

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 by jhn@…, 13 years ago

Cc: jhn@… added

by Andrew C Martin <andrew.c.martin@…>, 12 years ago

patch for trac 0.12-stable

in reply to:  4 comment:7 by Andrew C Martin <andrew.c.martin@…>, 12 years ago

Cc: andrew.c.martin@… added
Summary: Support list of users as options list in ticket custom field [patch included][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…

comment:8 by derek@…, 12 years ago

@andrew nice one! for me it works like a charm

comment:9 by larsivi@…, 12 years ago

@Andrew: Slightly off topic - did you use software to convert StarTeam CRs, milestones and such to Trac? If so, is it available somewhere? I'm aware of some softwares to do the changeset conversion to a different VCS, but not ticket conversion.

in reply to:  9 comment:10 by Andrew C. Martin <andrew.c.martin@…>, 12 years ago

Replying to larsivi@…:

no, I did not.

comment:11 by Ryan J Ollos, 9 years ago

Status: reopenednew

comment:12 by massimo.b@…, 8 years ago

Cc: massimo.b@… added

comment:13 by walty <walty8@…>, 8 years ago

Cc: walty8@… added

comment:15 by Ryan J Ollos, 7 years ago

TracUserSelectFieldPlugin has implemented a simple version of a user field. Comments on implementation in th:#13268.

comment:16 by Ryan J Ollos, 5 years ago

See also comment:4:ticket:11469, which proposes a ICustomFieldTypeProvider interface.

comment:17 by Ryan J Ollos, 5 years ago

Milestone: unschedulednext-dev-1.5.x

comment:18 by Ryan J Ollos, 3 years ago

Milestone: next-dev-1.5.xnext-dev-1.7.x

Milestone renamed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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