New way to validate an Issue

By default, JIRA provides :

  • a way to validate only field's format (Integer, Date, ...) during an Issue Edit through Field Context configuration,
  • validation capacities (defined in Workflow) on Issue Creation, but used validators are not able to focus error in the Create Screen.
By using Minyaa, the Issue Validation capacities will be extended.

How to extend Issue Validation on Create and Edit operations

The default actions for Issue Creation and Issue Edition have been overridden in order to provide an new way to validate the inputs.

These new actions allow to implements a set of validators in the Workflow definition.

The Workflow definition can be done directly from the extended ViewWorkflowSteps screen, where it is possible to :
  • append a meta-attribute in the <initial-actions>,
  • add a Global Action linked to the Issue Edition. Many Global Actions can be added, but only the first having the valid meta-attribute will be assumed as linked to the Edit operation.

    If more than one Global Action is needed, then the link has to be broken by removing the added meta-attribute.
Workflow.Inital.and.Global.Actions



What is done in Workflows

Meta-attribute are added :
  • for Issue Creation action :

    <meta name="minyaa.jira.operation.id">0</meta>
  • for Issue Edition action :

    <meta name="minyaa.jira.operation.id">1</meta>
It is the way to identify the action linked to the Edit and Create Operations. (Optional for Issue Creation). Workflow definition has to be like below ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.8//EN" 
	"http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
<workflow>
	<meta name="jira.description">...</meta>
	<initial-actions>
		<action id="1" name="Create Issue" >
			<meta name="minyaa.jira.operation.id">0</meta>
			...
            <validators>
                <validator type="class">
					...
                </validator>
            </validators>
			<results>
				...
			</results>
		</action>
	</initial-actions>
	<global-actions>
		<action id="2" name="Edit Issue"  >
			<meta name="minyaa.jira.operation.id">1</meta>
			...
            <validators>
                <validator type="class">
					...
                </validator>
            </validators>
			<results>
				<!-- Notice that the value -1 for step means that the step is unchanged after the transition -->
				<unconditional-result old-status="Not Done" status="Done" step="-1">
				</unconditional-result>
			</results>
		</action>
	</global-actions>
	<common-actions>
      ...
	</common-actions>
	<steps>
      ...
	</steps>
</workflow>

How to develop a Workflow Validator usable in Create and Edit operations