Why are StepDescriptors of an all-to-all workflow returning empty lists for getActions()?

Nathan Tonani June 19, 2017

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'.

1 answer

1 vote
Abraham - New Verve Consulting November 26, 2019

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}}"

 

Suggest an answer

Log in or Sign up to answer