Post Function ScriptRunner - Error on checking custom filed and assigning Status to issue on Create

During a issue Create, i want to check a Custom field (single select drop down) if specific value is selected we want to set issue status to a specific status.

I have added follwoing as apost function in create transition

cfValues['Submit for Review?']?.value == 'YES, Submit for Review'

and if this is true then set issue to "MGR Review" as a status

the post function script runs but i see following error

2017-06-01 08:59:26,898 ERROR [utils.WorkflowUtils]: In-depth checking of each condition follows to determine why the action was not allowed.
2017-06-01 08:59:26,898 ERROR [utils.WorkflowUtils]:
It seems that you have tried to perform a workflow operation (MGR Review) that is not valid for the current state of this issue (ITCR-41). The likely cause is that somebody has changed the issue recently, please look at the issue history for details.
2017-06-01 08:59:26,898 ERROR [utils.WorkflowUtils]: Not attempting transition because of above errors.
Issue: ITCR-41
{
"full.module.key": "com.onresolve.jira.groovy.groovyrunnerrungroovy-function (java.lang.String)",
"canned-script": "com.onresolve.scriptrunner.canned.jira.workflow.postfunctions.FasttrackTransition (java.lang.String)",
"class.name": "com.onresolve.jira.groovy.GroovyFunctionPlugin (java.lang.String)",
"issue": "ITCR-41 (com.atlassian.jira.issue.IssueImpl)",
"passesCondition": "true (java.lang.Boolean)",
"transientVars": {
"issue": "ITCR-41 (com.atlassian.jira.issue.IssueImpl)",
"configuration": "com.opensymphony.workflow.config.DefaultConfiguration@4c533635",
"issueProperties": "{} (com.google.common.collect.EmptyImmutableBiMap)",
"currentSteps": "[SimpleStep@7[owner=, actionId=0, status=open]] (java.util.ArrayList)",
"store": "com.opensymphony.workflow.spi.ofbiz.OfbizWorkflowStore@37b2a50b",
"descriptor": "com.atlassian.jira.workflow.ImmutableWorkflowDescriptor@ab265f1",
"entry": "com.opensymphony.workflow.spi.SimpleWorkflowEntry@11034744",
"oldStatus": "IssueConstantImpl[[GenericEntity:Status][sequence,13][statuscategory,2][name,DRAFT][iconurl,/][description,null][id,10006]] (com.atlassian.jira.issue.status.StatusImpl)",
"context": "com.opensymphony.workflow.basic.BasicWorkflowContext@5c0fbaec",
"createdStep": "SimpleStep@7[owner=, actionId=0, status=open] (com.opensymphony.workflow.spi.SimpleStep)",
"originalissueobject": "null (org.codehaus.groovy.runtime.NullObject)",
"actionId": "1 (java.lang.Integer)",
"pkey": "ITCR (java.lang.String)",
"changeItems": "[com.atlassian.jira.issue.history.ChangeItemBean@3fc6dcec[fieldType=jira,field=status,from=10006,fromString=DRAFT,to=10006,toString=DRAFT,created=<null>]] (java.util.LinkedList)"
},
"log": "org.apache.log4j.Logger@2b60f0f2",
"issueInputParameters": "com.atlassian.jira.issue.IssueInputParametersImpl@26c2ab08"
}
Elapsed: 11 ms
CPU time: 0 ms
Cancel

1 answer

Is there a valid transition from the status after the create transition to the "MGR Review" status in your workflow? Can you attach a screenshot of your workflow please?

Also what version of ScriptRunner and JIRA are you using?

Is there a more detailed error message in the full atlassian-jira.log file?

Suggest an answer

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

Continuous visibility with the new Jira Software Cloud and Bitbucket Cloud integration

Hey Atlassian community, I am a PM on the Bitbucket Cloud team and I am excited to share that we just released an improvement to the Jira Software and Bitbucket Cloud integration. With the newly im...

148 views 0 4
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