I'm writing a Script Runner listener to automatically transition a linked issue and it's subtasks based on whether a component is added or removed to the base issue.
I see I can get all the available workflow actions using
jiraWorkflow.getAll AvailableActions("");This lists all the available actions for the whole workflow.
I can also get all the available actions called a name (Reject in this case) with
jiraWorkflow.getActionsByName("Reject");which can result in several items in my collection if the workflow has several actions(transitions) called Reject
I can iterate through these to find the one that matches the current workflow status and use that, but this seems messy and I'm not confident it's robust to different workflows which may have shared transitions (which give a parent status name of null) and individual transitions with the same name.
Is there a cleaner method to find the available actions for the current point in the workflow?