History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRA-9844
Type: Bug Bug
Status: Verified Verified
Priority: Major Major
Assignee: Unassigned
Reporter: Jeff Turner [Atlassian]
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JIRA

Validators silently break Bulk Transition

Created: 06/Apr/06 03:55 AM   Updated: 15/Oct/06 06:33 PM
Component/s: Bulk Operations
Affects Version/s: 3.6, 3.5.3
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Reference

Participants: Jeff Turner [Atlassian]
Since last comment: 109 weeks, 5 days ago
Labels:


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Turner [Atlassian] - 06/Apr/06 03:56 AM
Verified to happen in 3.5.3 and 3.6

Jeff Turner [Atlassian] - 06/Apr/06 04:02 AM
To fix this, we need to present the user with a list of untransitioned issues, with details as to why their validators failed.

This illustrates why validators are not a good solution to the "make field required per transition" issue (JRA-5783).