I have a project in which for a certain issue type, in his workflow, I create a Script Post-Function of type 'Create a sub-task' in his create transition.
In the configuration, I set the 'Target Issue Type' and a summary for the subtask, that's all.
When I create the parent issue, and the script runs, the subtask is not created, and this is the error message shown in the log:
2015-02-06 11:58:49,171 http-bio-8080-exec-9 WARN JPulgarinB 718x11221x2 1igg7m8 172.28.110.62,127.0.0.1 /secure/QuickCreateIssue.jspa [jira.workflow.postfunctions.CloneIssue] Could not set security level, as the schemes between the two projects are different.
2015-02-06 11:58:49,207 http-bio-8080-exec-9 ERROR JPulgarinB 718x11221x2 1igg7m8 172.28.110.62,127.0.0.1 /secure/QuickCreateIssue.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] *************************************************************************************
2015-02-06 11:58:49,210 http-bio-8080-exec-9 ERROR JPulgarinB 718x11221x2 1igg7m8 172.28.110.62,127.0.0.1 /secure/QuickCreateIssue.jspa [scriptrunner.jira.workflow.ScriptWorkflowFunction] Script function failed on issue: null, actionId: 1, file: null
java.lang.NullPointerException
at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDefaultValue(SelectCFType.java:244)
at com.atlassian.jira.issue.customfields.impl.SelectCFType.getDefaultValue(SelectCFType.java:69)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getDefaultValue(CustomFieldImpl.java:1248)
at com.atlassian.jira.issue.IssueImpl.getCustomFieldValue(IssueImpl.java:1007)
at com.atlassian.jira.issue.IssueImpl.setCustomFieldValue(IssueImpl.java:1016)
at com.atlassian.jira.issue.MutableIssue$setCustomFieldValue$2.call(Unknown Source)
at com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue$_copyCustomFieldValues_closure3.doCall(AbstractCloneIssue.groovy:141)
at com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue.copyCustomFieldValues(AbstractCloneIssue.groovy:133)
at com.onresolve.scriptrunner.canned.jira.utils.AbstractCloneIssue.doScript(AbstractCloneIssue.groovy:62)
at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CreateSubTask.super$2$doScript(CreateSubTask.groovy)
at com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.CreateSubTask.doScript(CreateSubTask.groovy:120)
Any ideas of what is happening??
By the way, when I have a parent issue and create the subtask manually, it is created without any problem.