Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner "Create a sub-task" post function fails because "Sub-Task Issue cannot be null."

jmoreaux
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 27, 2020

I'm using the Create a sub-task scriptrunner post function.  The only way that I can get it to work is if I set "Fields to copy" to All.

Setting it to None or even Custom causes the post function to fail with the following error in the Logs:

2020-07-27 17:12:49,389 ERROR [workflow.ScriptWorkflowFunction]: *************************************************************************************
2020-07-27 17:12:49,389 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: XXX-3143, actionId: 11, file: null
java.lang.IllegalArgumentException: Sub-Task Issue cannot be null.
	at com.atlassian.jira.config.DefaultSubTaskManager.createSubTaskIssueLink(DefaultSubTaskManager.java:414)
	at com.atlassian.jira.config.SubTaskManager$createSubTaskIssueLink.call(Unknown Source)
	at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CreateSubTask.doScript(CreateSubTask.groovy:150)

 

My condition basically searches a multi select field for a specific example:
cfValues["Discipline"]*.value.contains("Concept")

I have the Target Issue Type set to Sub-task.

I have a simple additional issue action to append the name of the discipline to the end of the existing summary:

issue.summary = issue.summary + " Concept"

 

The only way I can get it to work is to specify that All fields get copied over instead of 'None' or 'Custom'.  This creates a lot of bloat and requires cleanup after creation. Capture.PNG

1 answer

1 accepted

1 vote
Answer accepted
jmoreaux
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 13, 2020

Updated Scriptrunner to 6.5.0 and it addressed the issue.

Suggest an answer

Log in or Sign up to answer