Its fine to use them in behaviours and ScriptRunner provides methods which allow you to get this information easily.
To access action name in behaviours you can use:
def transitionName = getActionName()
To access workflow related information in behaviours you can use the following methods:
|getActionName()||Returns the name of the current action if the issue is undergoing a workflow action, null otherwise.|
|getAction()||Returns an ActionDescriptor object if the issue is undergoing a workflow action, null for Edit, Assign, etc.|
|getDestinationStepName()||Returns the name of the destination step if the issue is undergoing a workflow action, null otherwise.|
|getDestinationStep()||Returns an StepDescriptor object for the destination step if the issue is undergoing a workflow action.|
You should see these methods at the bottom when editing the behaviours script.
I added the following code snippet which I have been successfully using in to condition groovy scripts:
ComponentManager componentManager = ComponentManager.getInstance()
JiraWorkflow workflow = componentManager.getWorkflowManager().getWorkflow(issue);
transitionName = workflow.getDescriptor().getAction(transientVars["actionId"]).getName()
but the transientVars map does not exist and I'm unaware of how to create it.
Can I get the transitionName without using transientVars?
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.Read more
Atlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs