﻿ticket	summary	type	release	owner	status	created	modified	_description	_reporter
13407	Enforce field requirement on state *AND* resolution type	enhancement			new	2018-04-07T02:15:13+02:00	2018-04-07T02:15:13+02:00	"At the moment ticket validator plugin is able to enforce required fields associated to ticket workflow states. It would be useful for it to be applied to states *AND* owner or resolution type. For example, enforce field requirement on the closed state and resolution type ""fixed"", and force the resolver to enter in the SHA which resolves the defect."	solstice333
8897	Validate on ticket type and match all statuses	enhancement	0.11		new	2011-06-14T19:03:48+02:00	2018-04-07T21:58:54+02:00	"After user over longer time, I decided to publish an improvement of the
TicketValidatorPlugin:

- Check for all statuses of the ticket (requested in ticket #4742)
- Check dependent on type of the ticket (requested in ticket #6067).

Details can be found in validator.txt in the source (ticketvalidator.zip). Here is some example:

{{{#!ini
[ticketvalidator]
new.required = purpose
*.required = address
done.*.required = weather, brightness
*.integer = age, lines_of_code
*.task.float = cost
}}}

This means:

- If the state is 'new', the field 'purpose' must be filled-in.
- 'address' is always required.
- If the state is 'done', 'weather' and 'brightness' are required,
  independent on the type (of course, ""done.required = ..."" would do
  the same here).
- 'age' and 'lines_of_code' must always be integers.
- Independent on the state, 'cost' must be a float if the ticket type
  is 'task'.

More data types can be implemented easily.

Reinhard"	Reinhard Wobst
4934	StatusFixer encounters errors when TicketValidator is enabled	defect	0.11		new	2009-04-16T21:07:21+02:00	2019-09-23T19:15:08+02:00	"StatusFixer can not find the `force_status` action among the valid actions, though without TicketValidator enabled the action is present.

I am a rank beginner at Python, but I believe this may be caused by the redefinition of 'actions' at line 81 of `ticketvalidator/core.py` within function `_get_action_controllers()`.

Traceback attached."	ken.latham@…
4807	Internal Error on certain actions when TicketValidator is enabled	defect	0.11		new	2009-03-19T16:39:49+01:00	2019-09-23T18:38:21+02:00	"On evaluation of this !PlugIn I encountered a problem on our test-system.

'''Environment:'''

System: 
 * TRAC 0.11.1
 * Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

Configuration:
 * !TicketValidator-0.1-py2.5.egg
 * ticketvalidator.* = enabled (under [components])
 * No further configuration on !TicketValidator
 * In addition I use AdvancedTicketWorkflowPlugin-0.10dev-py2.5.egg

'''Problem Description:'''

Performing actions sometimes work and sometimes yield the an error (see bottom).
I could trace down the occurance to only happen if my current ticket state offers actions that have '''both''' triage and standard actions.

So it does not happen on ticket states that only show one or more standard actions, and it does not happen in ticket states that only show one triage action.

{{{
Oops…
Trac detected an internal error:

ValueError: need more than 1 value to unpack
}}}

{{{
Python Traceback
Most recent call last:

    * File ""C:\Python25\lib\site-packages\trac\web\main.py"", line 423, in _dispatch_request
      Code fragment:
       418. try:
       419. if not env and env_error:
       420. raise HTTPInternalError(env_error)
       421. try:
       422. dispatcher = RequestDispatcher(env)
       423. dispatcher.dispatch(req)
       424. except RequestDone:
       425. pass
       426. resp = req._response or []
       427.  
       428. except HTTPException, e:
      Local variables:
      Name	Value
      after 	[u' except RequestDone:', u' pass', u' resp = ...
      before 	[u' try:', u' if not env and env_error:', u' raise ...
      dispatcher 	<trac.web.main.RequestDispatcher object at 0x063BBCF0>
      e 	ValueError('need more than 1 value to unpack',)
      env 	<trac.env.Environment object at 0x06956EF0>
      env_error 	None
      exc_info 	(<type 'exceptions.ValueError'>, ValueError('need more than 1 value to ...
      filename 	'C:\\Python25\\lib\\site-packages\\trac\\web\\main.py'
      frames 	[{'function': '_dispatch_request', 'lines_before': [u' try:', u' ...
      has_admin 	True
      line 	u' dispatcher.dispatch(req)'
      lineno 	422
      message 	u'ValueError: need more than 1 value to unpack'
      req 	<Request ""POST u'/ticket/48'"">
      resp 	[]
      tb 	<traceback object at 0x06807990>
      tb_hide 	None
      traceback 	'Traceback (most recent call last):\n File ...
    * File ""C:\Python25\lib\site-packages\trac\web\main.py"", line 197, in dispatch
      Code fragment:
       192. req.args.get('__FORM_TOKEN') != req.form_token:
       193. raise HTTPBadRequest('Missing or invalid form token. '
       194. 'Do you have cookies enabled?')
       195.  
       196. # Process the request and render the template
       197. resp = chosen_handler.process_request(req)
       198. if resp:
       199. if len(resp) == 2: # Clearsilver
       200. chrome.populate_hdf(req)
       201. template, content_type = \
       202. self._post_process_request(req, *resp)
      Local variables:
      Name	Value
      chosen_handler 	<trac.ticket.web_ui.TicketModule object at 0x05E2F5D0>
      chrome 	<trac.web.chrome.Chrome object at 0x181043D0>
      ctype 	'application/x-www-form-urlencoded'
      err 	(<type 'exceptions.ValueError'>, ValueError('need more than 1 value to ...
      handler 	<trac.ticket.web_ui.TicketModule object at 0x05E2F5D0>
      options 	{}
      req 	<Request ""POST u'/ticket/48'"">
      self 	<trac.web.main.RequestDispatcher object at 0x063BBCF0>
    * File ""C:\Python25\lib\site-packages\trac\ticket\web_ui.py"", line 170, in process_request
      Code fragment:
       165.  
       166. def process_request(self, req):
       167. if 'id' in req.args:
       168. if req.path_info.startswith('/newticket'):
       169. raise TracError(_(""id can't be set for a new ticket request.""))
       170. return self._process_ticket_request(req)
       171. return self._process_newticket_request(req)
       172.  
       173. # ITemplateProvider methods
       174.  
       175. def get_htdocs_dirs(self):
      Local variables:
      Name	Value
      req 	<Request ""POST u'/ticket/48'"">
      self 	<trac.ticket.web_ui.TicketModule object at 0x05E2F5D0>
    * File ""C:\Python25\lib\site-packages\trac\ticket\web_ui.py"", line 490, in _process_ticket_request
      Code fragment:
       485. self._apply_ticket_changes(ticket, field_changes) # Apply changes made by the workflow
       486. # Unconditionally run the validation so that the user gets
       487. # information any and all problems. But it's only valid if it
       488. # validates and there were no problems with the workflow side of
       489. # things.
       490. valid = self._validate_ticket(req, ticket) and not problems
       491. if 'preview' not in req.args:
       492. if valid:
       493. # redirected if successful
       494. self._do_save(req, ticket, action)
       495. # else fall through in a preview
      Local variables:
      Name	Value
      action 	u'reinvestigate'
      actions 	['reassign', 'reinvestigate', 'triage deciding', 'close']
      data 	{'comment': None, 'preserve_newlines': True, 'ticket': ...
      field_changes 	{'status': {'new': u'Analysing', 'old': u'Deciding', 'by': ...
      id 	48
      problems 	[]
      req 	<Request ""POST u'/ticket/48'"">
      self 	<trac.ticket.web_ui.TicketModule object at 0x05E2F5D0>
      ticket 	<trac.ticket.model.Ticket object at 0x06895630>
      version 	None
    * File ""C:\Python25\lib\site-packages\trac\ticket\web_ui.py"", line 945, in _validate_ticket
      Code fragment:
       940. # Shouldn't happen in ""normal"" circumstances, hence not a warning
       941. raise InvalidTicket(_('Invalid comment threading identifier'))
       942.  
       943. # Custom validation rules
       944. for manipulator in self.ticket_manipulators:
       945. for field, message in manipulator.validate_ticket(req, ticket):
       946. valid = False
       947. if field:
       948. add_warning(req, _(""The ticket field '%(field)s' is ""
       949. ""invalid: %(message)s"",
       950. field=field, message=message))
      Local variables:
      Name	Value
      comment 	u''
      field 	{'custom': True, 'name': 'responsibility', 'value': u'Unknown', 'label': ...
      manipulator 	<ticketvalidator.core.RequiredFieldValidator object at 0x06261FF0>
      name 	'responsibility'
      replyto 	u''
      req 	<Request ""POST u'/ticket/48'"">
      resource 	<Resource u'ticket:48'>
      self 	<trac.ticket.web_ui.TicketModule object at 0x05E2F5D0>
      ticket 	<trac.ticket.model.Ticket object at 0x06895630>
      valid 	True
    * File ""build\bdist.win32\egg\ticketvalidator\core.py"", line 53, in validate_ticket
      Local variables:
      Name	Value
      req 	<Request ""POST u'/ticket/48'"">
      self 	<ticketvalidator.core.RequiredFieldValidator object at 0x06261FF0>
      ticket 	<trac.ticket.model.Ticket object at 0x06895630>
    * File ""build\bdist.win32\egg\ticketvalidator\core.py"", line 74, in _get_state
      Local variables:
      Name	Value
      action 	u'reinvestigate'
      action_changes 	{'status': u'Analysing'}
      controller 	<advancedworkflow.controller.TicketWorkflowOpTriage object at 0x062617F0>
      req 	<Request ""POST u'/ticket/48'"">
      self 	<ticketvalidator.core.RequiredFieldValidator object at 0x06261FF0>
      ticket 	<trac.ticket.model.Ticket object at 0x06895630>
    * File ""build\bdist.win32\egg\advancedworkflow\controller.py"", line 336, in get_ticket_changes
      Local variables:
      Name	Value
      action 	u'reinvestigate'
      req 	<Request ""POST u'/ticket/48'"">
      self 	<advancedworkflow.controller.TicketWorkflowOpTriage object at 0x062617F0>
      ticket 	<trac.ticket.model.Ticket object at 0x06895630>
    * File ""build\bdist.win32\egg\advancedworkflow\controller.py"", line 345, in _new_status 
}}}"	rolland.veres@…
