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

Scriptrunner - Issue with transition.

Hi All,


I am trying to resolve the parent, when all the child issues are resolved. 

The log/print statements show that the child issues are all "Done" and the parent can be closed.

The code gets stuck or errors during the validateTransition call.

I do not get any of the exceptions I am trying to catch.

The errorcollection at the end is also empty.


When I uncomment the transition() call line, I get an error that says 

NullPointerException: Cannot get property 'key' on null object


The currentuser.key has valid value.


Any help or pointers on how to debug would be greatly appreciated.


Thank you so much for your time !!!



Here is the snippet of my code (skipped the imports)




Issue issue = issue


def issueManager = ComponentAccessor.issueManager

def linkMgr = ComponentAccessor.getIssueLinkManager()

def close_status = 1

def src_obj


for (IssueLink link in linkMgr.getInwardLinks( {

    src_obj = link.getSourceObject()

    for (IssueLink link1 in linkMgr.getOutwardLinks( {

        def dest_obj = link1.getDestinationObject()

        log.warn("Child: " + dest_obj.key + "," +

        if ( != "Done") {

            close_status = 0





if (close_status == 1){

    log.warn("Close Parent")

    def issueLinkManager = ComponentAccessor.getIssueLinkManager();

    JiraAuthenticationContext authContext = ComponentAccessor.getJiraAuthenticationContext()


    com.atlassian.jira.user.ApplicationUser currentuser = authContext.getLoggedInUser()

    MutableIssue m_issue = (MutableIssue)src_obj

    MutableIssue p_issue = (MutableIssue) issueManager.getIssueObject(m_issue.key)

    String issuetype   =


    def transition = 171


    def issueService = ComponentAccessor.getIssueService()

    def issueInputParameters = issueService.newIssueInputParameters()





    def builder = new TransitionOptions.Builder()


    log.warn("Validate transition" + ", User: " + currentuser.key)

    log.warn("Validate transition" + ", Issue id: " +

    log.warn("Validate transition" + ", (M)Issue id: " +

    log.warn("Validate transition" + ", Transition: " + transition)

    log.warn("Validate transition" + ", Transition: " + issueInputParameters.retainExistingValuesWhenParameterNotProvided)

    log.warn("Validate transition" + ", Transition: " + issueInputParameters.applyDefaultValuesWhenParameterNotProvided)



    def transitionValidationResult;

    try {

        transitionValidationResult = issueService.validateTransition(currentuser,, transition, issueInputParameters)   


    catch(WorkflowException ex){

        log.warn("Exception:" + ex.getMessage())


    catch(org.ofbiz.core.entity.GenericTransactionException ex)


        log.warn("Exception:" + ex.getMessage())


    catch(Exception ex){

        log.warn("Exception:" + ex.getMessage())


    catch(Throwable ex){

        log.warn("Exception:" + ex.getMessage())




    def errorCollection = transitionValidationResult.errorCollection


    //issueService.transition(currentuser, transitionValidationResult)



1 answer

1 accepted

0 votes
Answer accepted

Script is not required:

In parent workflow for resolved status transition add a script runner postfunction:

"Transition parent when all subtasks are resolved"

Thank you for your answer.


That approach worked when sub-tasks were created from an Issue


However, that was not working when I created issues from Issues. 

i.e. Parent Issue -> Child Issue


Parent Issue -> subtasks ==> "Transition parent when all subtasks are resolved" works !

Parent Issue -> Child Issue ==> "Transition parent when all subtasks are resolved" does not work.


Is that post script meant to handle both these scenario?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

136 views 1 2
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