Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-9844

Validators silently break Bulk Transition

    XMLWordPrintable

Details

    Description

      If I have a workflow Validator set on a transition, and then try to bulk-transition issues through this transition, and if the validator fails, then:

      • The issue is not transitioned
      • No indication of this is given to the user
      • An error from the validator is logged

      For instance, given the following validator on the standard workflow:

              <action id="005" view="resolveissue" name="Resolve Issue">
                  ....
                  <validators>
                      <validator type="class">
                          <arg name="class.name">com.atlassian.jira.workflow.validator.TestValidator</arg>
                      </validator>
                  </validators>
      
      package com.atlassian.jira.workflow.validator;
      
      import com.opensymphony.workflow.Validator;
      import com.opensymphony.workflow.InvalidInputException;
      import com.opensymphony.workflow.WorkflowException;
      import com.opensymphony.module.propertyset.PropertySet;
      
      import java.util.Map;
      
      public class TestValidator implements Validator
      {
          public void validate(Map map, Map map1, PropertySet propertySet) throws InvalidInputException, WorkflowException
          {
              System.out.println("Validator called");
              throw new InvalidInputException("TestValidator failed");
          }
      }
      

      when bulk resolving an open issue, the following appears in the logs:

      Validator called
      2006-04-06 18:47:51,493 ERROR [atlassian.jira.workflow.SimpleWorkflowManager] An exception occurred
      [InvalidInputException: [Error map: [{}]] [Error list: [[TestValidator failed]]]
      	at com.atlassian.jira.workflow.validator.TestValidator.validate(TestValidator.java:17)
      	at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(AbstractWorkflow.java:985)
      	at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1198)
      	at com.opensymphony.workflow.AbstractWorkflow.doAction(AbstractWorkflow.java:533)
      	at com.atlassian.jira.workflow.SimpleWorkflowManager.doWorkflowAction(SimpleWorkflowManager.java:228)
      	at com.atlassian.jira.bulkedit.operation.BulkWorkflowTransitionOperation.perform(BulkWorkflowTransitionOperation.java:103)
      	at com.atlassian.jira.web.action.issue.bulkedit.BulkWorkflowTransition.doPerform(BulkWorkflowTransition.java:187)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      

      and the issue is not transitioned.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              7ee5c68a815f Jeff Turner
              Votes:
              34 Vote for this issue
              Watchers:
              35 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: