Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can we retrieve transition Id from transition name?

Happy New Year to everyone :)

Could any one please guide me how to retrieve transition Id from transition name?
I want to transition a linked issue through groovy script from custom script post function:
Here is the current rough script:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.workflow.TransitionOptions
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.workflow.IssueWorkflowManager
import com.opensymphony.workflow.loader.ActionDescriptor
import com.atlassian.jira.workflow.edit.layout.display.TransitionOption
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.issue.Issue
import static P3_Constants.Status
import static P3_Constants.Transition

def issueLinkManager = ComponentAccessor.issueLinkManager
def issueManager = ComponentAccessor.issueManager
ApplicationUser loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def issueService = ComponentAccessor.issueService
IssueWorkflowManager issueWorkflowManager
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()

def movedIssues = issueLinkManager.getOutwardLinks(

def movedIssueObjects = movedIssues.findAll { == 'ABC'
}.collect {

//def transitionOptions = new TransitionOptions.Builder().skipConditions().skipPermissions().skipValidators().build()
TransitionOptions.Builder transitionOptionsBuilder = new TransitionOptions.Builder()
TransitionOptions transitionOptions = ()

movedIssueObjects.each {
def outerIssue = issueManager.getIssueObject(it.toString())
log.error "outerIssue---"+outerIssue
def linkedIssue = outerIssue as Issue
log.error "linkedIssue--"+linkedIssue
if (outerIssue.status.getName() != {

log.error ""
log.error "transitionOptions---"+transitionOptions

ActionDescriptor issueTransition = issueWorkflowManager.getAvailableActions(linkedIssue, transitionOptions, loggedInUser).find { ==}
log.error ""
assert issueTransition != null : "Workflow Action ${} not found"

def transitionValidationResult = issueService.validateTransition(loggedInUser,,, issueInputParameters, transitionOptions)
if (transitionValidationResult.valid) {
def transitionResult = issueService.transition(loggedInUser, transitionValidationResult)
if (transitionResult.valid)
log.debug "Transitioned issue ${outerIssue} through action ${}"
log.debug 'Transition result is not valid'
log.debug 'The transitionValidation is not valid'


Problem: It always gives a NullPointerException for method getAvailableActions()


Below are the logs:

2022-01-05 16:33:30,073 ERROR [runner.ScriptBindingsManager]: outerIssue---XYZ-362
2022-01-05 16:33:30,074 ERROR [runner.ScriptBindingsManager]: linkedIssue--XYZ-362
2022-01-05 16:33:30,074 ERROR [runner.ScriptBindingsManager]:
2022-01-05 16:33:30,075 ERROR [runner.ScriptBindingsManager]: transitionOptions---com.atlassian.jira.workflow.TransitionOptions@310b87eb
2022-01-05 16:33:30,080 ERROR [workflow.AbstractScriptWorkflowFunction]: Workflow script has failed on issue BUS-3784 for user 'swapnil'. View here: http://localhost:8080/secure/admin/workflows/ViewWorkflowTransition.jspa?workflowMode=live&workflowName=Workflow+for+Project+BUS&descriptorTab=postfunctions&workflowTransition=1&highlight=4
java.lang.NullPointerException: Cannot invoke method getAvailableActions() on null object
	at P3.Script486$_run_closure3.doCall(Script486.groovy:43)

2 answers

0 votes
John Funk Community Leader Jan 05, 2022

Hi Swapnil - you can get the transition ID by clicking on the Text link while on the workflow. 

0 votes
Pramodh M Community Leader Jan 05, 2022


Use the below API to get the transition 

You need the Issue key as an input parameter to get the transitions associated with that issue and by filtering the Issue transition name you can get the ID


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

759 views 24 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you