JIRA Server v7.2.3
I've written a transition utility that recently started failing when dealing with an all-to-all workflow (all Steps can transition to all Steps in the workflow, including itself). After debugging, I found that 'StepDescriptor.getActions()' returns an empty list for any StepDescriptor in the all-to-all. I'd expect to see a transition for every Step in the workflow, any reason why the API returns an empty list?
I'll also note that 'JiraWorkflow.getActionsWithResultStepDescriptor()' correctly provides the expected transition, as does the REST API via 'GET /rest/api/2/issue/{issueIdOrKey}/transitions'.
Hi Nathan,
I still have the same question and the only thing I could find that would return all-to-all transitions (on top of normal regular transitions) is IssueWorkflowManager (https://docs.atlassian.com/software/jira/docs/api/8.4.3/com/atlassian/jira/workflow/IssueWorkflowManager.html).
If you use this code in the ScriptRunner script console (server), you can test it yourself:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.workflow.IssueWorkflowManager
def issueWFMngr = ComponentAccessor.getComponentOfType(IssueWorkflowManager.class)
def currentIssue = ComponentAccessor.issueManager.getIssueByCurrentKey("KS-1") // your issue key here instead of KS-1
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def trueAvailableActions = issueWFMngr.getAvailableActions(currentIssue, currentUser)
return "Available actions/transitions: ${trueAvailableActions.collect {it.name + ': '+ it.id}}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.