Hello Community ,
Can you help me please in determining how to get the Workflow Transition condition details with Scriptrunner ?
I used this method :
// Get the conditions
def conditions = workflow.allActions.collect { action ->
def transitionName = action.name
def conditionDescriptor = action.getRestriction()?.getConditionsDescriptor()
def conditionName = conditionDescriptor?.conditions.each {ConditionDescriptor condition ->
def conditionName = condition.getArgus()
}
but it does not work , I get the following error : No signature of method: Script543$_run_closure1$_closure4$_closure7.doCall() is applicable for argument types: (com.opensymphony.workflow.loader.ConditionsDescriptor) values: [com.opensymphony.workflow.loader.ConditionsDescriptor@4c312dce] Possible solutions: doCall(com.opensymphony.workflow.loader.ConditionDescriptor), findAll(), findAll(), isCase(java.lang.Object), isCase(java.lang.Object)
Anyone can help please .
Thank you in advance .
Could you please provide a little bit more information, i.e. why are you trying this approach and what information are you trying to obtain?
I am looking forward to your clarification.
Thank you and Kind regards,
Ram
Hi @Ram Kumar Aravindakshan _Adaptavist_
Thank you for feedback .
Actually I would like to retrieve the conditions Names inside the transition Conditions section in a workflow
Example :
Best ,
Mohamed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ,
Is there anyone who can help me out ?
Thanks you in advance .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mohamed,
The following works for me to get the various details of the conditions defined for a specific transition. I was just dumping the "rval" back to the scriptrunner console for confirmation.
...
JiraWorkflow jiraWorkflow = workflows.getWorkflow(true, "jira with Blocking");
Collection<ActionDescriptor> allActions = jiraWorkflow.getActionsByName("Close Issue");
for (ActionDescriptor action : allActions) {
RestrictionDescriptor restrictionDescriptor = action.getRestriction();
if (restrictionDescriptor != null)
List<ConditionDescriptor> conditions = restrictionDescriptor.getConditionsDescriptor().getConditions();
for (ConditionDescriptor condition : conditions) {
rval = rval + "<br/>" + action.getName() + " (" + action.getId() + ") -> " + condition.getArgs() + "<br/>";
}
}
}
...
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.