Edgewall Software
Modify

Opened 13 years ago

Last modified 15 months ago

#2463 new enhancement

Mandatory fields in tickets

Reported by: johan.regnell@… Owned by:
Priority: high Milestone: next-major-releases
Component: ticket system Version: 0.9.2
Severity: normal Keywords:
Cc: kantrn@…, mark.mcmahon@…, kirean@…, leho@…, trac@…
Release Notes:
API Changes:

Description

It would be great with ability to set some ticket fields as mandatory. These fields should be verified before allowing submit when creating a new ticket.

Attachments (2)

preliminary_required_fields_change.patch (2.3 KB ) - added by Mark Mc Mahon <mark.mcmahon@…> 8 years ago.
Very first attempt at implementing required ticket fields
add_required_fields_inclde_new_ticket.patch (3.2 KB ) - added by Mark Mc Mahon <mark.mcmahon@…> 8 years ago.
Add

Download all attachments as: .zip

Change History (22)

comment:1 Changed 12 years ago by anonymous

Hi,

is anyone actively working on this?

If so, is there a guess, when this enhancement might be available, without defining a whole new Workflow?

TIA Max

comment:2 Changed 12 years ago by Noah Kantrowitz (coderanger) <coderanger@…>

Cc: kantrn@… added

This is indeed possible in 0.10. I will see about coding it up later this week.

comment:3 Changed 12 years ago by Christian Boos

Milestone: 1.0

Hey that week is over, where's the patch? :-)

See also the antonym ticket #2464

comment:4 Changed 11 years ago by osimons

Milestone: 1.00.12

#6248 closed as duplicate. It requests making standard and custom fields mandatory, or at least marking them visually in a special way (related to #899, #925, #1748).

Rescheduling according to #6248 value recently updated by cboos.

comment:5 Changed 10 years ago by Remy Blank

Closed #5567 as a duplicate.

comment:6 Changed 9 years ago by Remy Blank

#8464 was closed as a duplicate.

comment:7 Changed 9 years ago by anonymous

What's happening with this ticket

comment:8 Changed 9 years ago by velappanv@…

Hi All,

This would be great future if we implemented this? Did any have any idea to work on this please share with us so we iwe can work on the same and release it as soon as possible.

~vela

comment:9 Changed 8 years ago by Mark Mc Mahon <mark.mcmahon@…>

I tried to throw something together for this.

It currently is a very basic patch that works in the following way:

  • You define in the trac.ini file which fields are required for which workflow actions e.g.
      accept.required_fields = component,version
    
  • When validating the ticket on submission these fields are checked not to be empty.

Problems with this patch:

  • No tests
  • No documentation
  • No handling of required fields when creating a new ticket (my proposal here is to have a list of required fields in the [ticket] configuration section which would always be required (so new and every other state)

I would appreciate feedback as to whether this is the right approach before doing much more work on it. (for example - the code to retrieve the workflow actions in _validate_ticket() seem over complicated - maybe there is an easier way?

Changed 8 years ago by Mark Mc Mahon <mark.mcmahon@…>

Very first attempt at implementing required ticket fields

comment:10 Changed 8 years ago by Mark Mc Mahon <mark.mcmahon@…>

Cc: mark.mcmahon@… added

(adding comment so that "Add to Cc" is not flagged as spam.

comment:11 Changed 8 years ago by Remy Blank

Milestone: next-major-0.1X0.13
Owner: changed from Jonas Borgström to Remy Blank
Priority: normalhigh

Required fields dependent on the workflow? Interesting idea! There would indeed need to be an additional list for ticket creation, as that was the original request. Making that list apply to all workflow transitions makes sense to me.

Changed 8 years ago by Mark Mc Mahon <mark.mcmahon@…>

Add

comment:12 Changed 8 years ago by Mark Mc Mahon <mark.mcmahon@…>

This latest patch adds required fields when creating a ticket also.

I had a look at the Genshi template 'ticket.html' and when the required fields are passed in the data to the template it should be easy enough to add '*' or change the format to the required fields.

<span py:if="'description' in required_fields">* </span> 
    Description:</label></th>

Any input appreciated.

comment:13 Changed 8 years ago by Erik Andersson <kirean@…>

Cc: kirean@… added

comment:14 Changed 8 years ago by lkraav <leho@…>

Cc: leho@… added

comment:15 Changed 8 years ago by Mark Mc Mahon <mark.m.mcmahon@…>

In the meantime while this is being discussed there is already hack that implements this: http://www.matbooth.co.uk/trac/wiki/TicketValidationStart (author Matt Booth)

comment:16 Changed 8 years ago by Remy Blank

The TicketValidationStart plugin looks really nice. The idea of associating required fields with status transitions, while elegant and quite simple to implement, doesn't capture the real need. Indeed, a field is required not for a transition, but for the end status. If the check is only performed on transitions, it would be possible to clear a required field after the transition.

So I would rather go with an implementation specifying required fields based on (at least) the status. Arbitrary boolean expressions are a nice addition, but I wouldn't want to add a new dependency on pyparsing just for parsing boolean expressions. Such a simple parser could probably be implemented relatively easily "by hand", though.

We could even have multiple expressions per field, and associate a message to be displayed to the user if the expression is false. This could all be defined in the [ticket-custom] section in trac.ini, with message translations (see #9648).

comment:17 in reply to:  16 Changed 8 years ago by trac@…

Cc: trac@… added

Replying to rblank:

The TicketValidationStart plugin looks really nice. The idea of associating required fields with status transitions, while elegant and quite simple to implement, doesn't capture the real need. Indeed, a field is required not for a transition, but for the end status. If the check is only performed on transitions, it would be possible to clear a required field after the transition.

A state transition occurs only when the user chooses to change the state by using a work flow action. The rules in the TicketValidation are run every time you submit the ticket whether a state transition occurs or not. So, if you want a field to be mandatory when the "state == closed" then that field will be mandatory until the ticket is reopened.

So I would rather go with an implementation specifying required fields based on (at least) the status. Arbitrary boolean expressions are a nice addition, but I wouldn't want to add a new dependency on pyparsing just for parsing boolean expressions. Such a simple parser could probably be implemented relatively easily "by hand", though.

You are probably right, but we wanted to get a plug-in working as soon as possible, and using a library helped us with that.

comment:18 Changed 8 years ago by Remy Blank

Oh, my comment about pyparsing wasn't meant to be criticism of your plugin: if it works for you, great! It was meant to define a requirement if something similar should be included in Trac core.

comment:19 Changed 8 years ago by Remy Blank

Milestone: 0.13next-major-0.1X

comment:20 Changed 7 years ago by Remy Blank

Owner: Remy Blank deleted

Refocusing.

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.
The owner will be changed from (none) to anonymous.

Add Comment


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