I add a condition on a transition of my workflow for hiding the button on the from transitions-all.
but I found I cannt go to the next step .
my condition is that:
public class NoShowButtonCondition extends YhdWorkflowCondition{
@Override
public boolean passesCondition(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
}
my code for go to the next step of workflow is below:
IssueInputParameters issueInputParametersBussiness = issueService.newIssueInputParameters();
issueInputParametersBussiness.setAssigneeId(parentIssue.getAssigneeId());
issueInputParametersBussiness.setComment("update the state of the workflow");
issueInputParametersBussiness.setResolutionId(parentIssue.getResolutionId());
IssueService.TransitionValidationResult transitionValidationResult
= issueService.validateTransition(user, parentIssueId, nextActionid, issueInputParametersBussiness);
if (transitionValidationResult.isValid()) {
IssueService.IssueResult transitionResult = issueService.transition(user, transitionValidationResult);
if (transitionResult.isValid()) {
System.out.println("OK");
} else {
System.out.println("SORRY");
}
} else {
List<String> errorList = new ArrayList();
errorList.addAll(transitionValidationResult.getErrorCollection().getErrorMessages());
for (int i = 0; errorList != null && i < errorList.size(); i++) {
System.out.println("the error msg is :" + errorList.get(i));
}
}
and the transitionResult.isValid() is false and the error mesage is below
It seems that you have tried to perform a workflow operation (xXXXX) that is not valid for the current state of this issue (TRIDENT-61).
The likely cause is that somebody has changed the issue recently, please look at the issue history for details.
who can tell me what the reason is and how i can program
I want to hide the button on the workflow and go to the next step by programing
TKS!!!
Community moderators have prevented the ability to post new answers.
Hey, this is not a solution but the Misc Workflow Extensions plugin has the "hide transition" condition by default selectable from the UI:
https://marketplace.atlassian.com/plugins/com.innovalog.jmwe.jira-misc-workflow-extensions
Depending on your JIRA version it's free of charge:-)
Cheers
Hi, have you got an answer or have solved this? I am facing to similar problem now. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.