scriptrunner.jira.workflow.ScriptWorkflowFunction failed

Good morning,

I'm trying to execute a groovy script in order to transition linked issue status when another issue change status.

My code is:

def com.atlassian.crowd.embedded.api.User user = ComponentManager.instance.jiraAuthenticationContext.getLoggedInUser()
    IssueService issueService = ComponentManager.getInstance().getIssueService();
    IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
    TransitionValidationResult transitionValidationResult = issueService.validateTransition(user, newIssue.getId(), 11, issueInputParameters);
    if (transitionValidationResult.isValid())
        log.debug "OK"
        def transitionResult = issueService.transition(user, transitionValidationResult);
        if (!transitionResult.isValid())
            log.debug "KO"
        //    // Do something
            log.debug "KO"
        log.debug "KO"

The script works properly, the linked issue's status is correctly changed but in the log I see this error:

2014-11-07 09:28:40,295 ... ERROR ... /secure/CommentAssignIssue.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: XXX-16, actionId: 11, file: customScripts\XXX.groovy
    at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(
    at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(
    at com.atlassian.jira.issue.IssueManager$ Source)
    at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runScript(ScriptRunnerImpl.groovy:403)
    at com.onresolve.scriptrunner.runner.ScriptRunner$runScript$7.callCurrent(Unknown Source)
    at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.runFileAsScript(ScriptRunnerImpl.groovy:182)
    at com.onresolve.scriptrunner.runner.ScriptRunner$runFileAsScript$ Source)
    at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate.doScript(CustomScriptDelegate.groovy:47)
    at com.onresolve.scriptrunner.canned.jira.utils.CustomScriptDelegate$doScript$ Source)
    at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CustomScriptFunction.doScript(CustomScriptFunction.groovy:20)
Caused by: com.atlassian.jira.workflow.WorkflowException
    at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(
    at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(
    ... 10 more
Caused by: java.lang.NullPointerException
    at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(

How can I solve and remove this error?

Thank you in advance

1 answer

1 accepted

It must be a different script - it's caused by a problem createIssue on line 114 of your script, yet I don't see any call to that in the script you posted.

The reindex should not be required.

FWIW, createIssue seems to be failing because the project is broken or missing...

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 13, 2019 in Marketplace Apps

Marketplace Spotlight: Marketing apps for Confluence to keep your teams working on the same page


247 views 0 6
Read article

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