IssueService.IssueResult transition doesn't modify the status of the issue after a specified transition

Hi Atlassians,

Inside my postfunction, I'm using IssueService.IssueResult transition method in order to transition an issue through workflow.

As specified in the documentation, the issue will be saved and re-indexed and the transition will be made.(, com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult) ).

As I understand from that, there is no need to update the issue by code as this method will do it.

In my code, I noticed that the transition is happening (by checking History tab) but the issue is not saved (Status is not modified). I used to put issueManager.updateIssue (kindly ckeck highlighted line in the below code) after it in order to force updating the issue.

My question is: Why implementing IssueService.IssueResult transition is not enough to save the issue after transitioning it?

My code is the following:

TransitionValidationResult transitionValidRes = issueService.validateTransition(authenticationContext.getUser().getDirectoryUser(),issue.getId(),configAction.getId(), issueInputParameters);

log.debug("Current Status of the issue: " + issue.getStatusObject().getName());

log.debug("Action ID: " + configAction.getId());

if (!transitionValidRes.isValid())


Iterator<String> ite = transitionValidRes.getErrorCollection().getErrorMessages().iterator();

StringBuilder sb = new StringBuilder();

while (ite.hasNext())





throw new Exception(sb.toString());


ErrorCollection transitionErrorCollection = issueService.transition(authenticationContext.getUser().getDirectoryUser(), transitionValidRes).getErrorCollection();

if (transitionErrorCollection.hasAnyErrors())






log.debug("New Status of Issue: " + transitionValidRes.getIssue().getStatusObject().getName());



issueManager.updateIssue(authenticationContext.getUser().getDirectoryUser(), issue, EventDispatchOption.ISSUE_UPDATED, false);



3 answers

This widget could not be displayed.

Generally, trying to transition an issue while another transition is still executing does not work.

What you've got there would probably work fine in a listener, but I've never seen it work in a post-function (in fact, had jobs cleaning up the mess made by people trying to do this)

I do know it can be done - the script runner and jjupin plugins appear to be doing a transition in a post-function, but it's really not as simple as just trying to kick off a new transition using the issue service (I know at least one of those plugins is effectively starting the transtion after the first one ends),

This widget could not be displayed.

Thanks Nic.

However, when I checked the code inside Fast Track Script Runner, I noticed that the same method is being used: issueService.transition


public static Issue actionIssue(String additionalScript, MutableIssue theIssue, Integer actionId, User user, Map scriptParams = [:]) {

IssueService issueService = ComponentAccessor.getIssueService()

IssueInputParameters issueInputParameters = new IssueInputParametersImpl([:])

scriptParams.put("issueInputParameters", issueInputParameters)

ConditionUtils.doAdditional(additionalScript, theIssue, scriptParams)

issueInputParameters = scriptParams['issueInputParameters'] as IssueInputParameters

def validationResult = issueService.validateTransition(user,, actionId as Integer, issueInputParameters)

ErrorCollection errorCollection = validationResult.errorCollection

if (errorCollection.hasAnyErrors()) {

// We used to carry on because sometimes these seem spurious. More investigation needed.

log.error (errorCollection)

log.error ("Not attmpting transition")

return null


errorCollection = issueService.transition(user, validationResult).errorCollection

if (errorCollection.hasAnyErrors()) {

log.error (errorCollection)


else { ("Transitioned issue $theIssue through action \"$actionId\"")


// reload issue

theIssue = ComponentAccessor.getIssueManager().getIssueObject(

Status finalStatus = theIssue.statusObject

log.debug "Final status: ${finalStatus.getName()} (${})"





This widget could not be displayed.

I have the same question. I have been struggling to get this to work, without success, as a listener for a couple of days now sad

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

26 views 0 1
Join discussion

Atlassian User Groups

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!

Find my local user group

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

Groups near you