Simple Scripted Conditions not accepting changes in workflow.

We have several workflows that are using the simple script condition, 

  • Script workflow function : Does not allow the action unless all sub-tasks have the Completed resolution set.

These were implemented prior to our upgrade of both JIRA and Scriptrunner, from 6.1.6 to 6.3.15 and from 2.1.16 to 3.0.16 respectively.  When we try to add this same condition to a workflow in the upgraded environment, it will not accept the chosen resolution.  When we click the preview button, it shows the correct value, but when we hit Update, the value is reset to Any.  I have verified this by viewing the workflow xml files.

 

This is the correct xml that was from the workflow that was created before the upgrade

<condition type="class">
<arg name="RESOLUTION_FIELD_NAME">11</arg>
<arg name="scriptFileName">
com.onresolve.jira.groovy.canned.workflow.conditions.AllSubtasksResolvedCondition
</arg>
<arg name="class.name">com.onresolve.jira.groovy.GroovyCondition</arg>
</condition>

This is the xml from the workflow that is being changed after the upgrade

<condition type="class">
<arg name="RESOLUTION_FIELD_NAME"/>
<arg name="canned-script">
com.onresolve.scriptrunner.canned.jira.workflow.conditions.AllSubtasksResolvedCondition
</arg>
<arg name="class.name">com.onresolve.jira.groovy.GroovyCondition</arg>
</condition>

The Resolution_Field_Name is not accepting the argument value.  Please help!

2 answers

4 votes

This is an irritating bug that affects the params of just this script. Until the next release, if configuring this script, you have two options.

Either, update the workflow manually to be as it should be, which you already know. Can do this through importing or directly editing in the database etc.

Or, using simple scripted condition. You mention that in the question but you are not actually using that, you are using "All subtasks must be resolved" script. There is another built-in option called Simple Scripted Condition, and the script would be:

issue.subTaskObjects.every {it.resolutionObject?.name == "Won't Fix"}

or

issue.subTaskObjects.every {it.resolutionObject?.id == "11"}

There is not much more to this built-in script than that.

 

0 vote

Seems there is some kind of issue with that one. I will look at that tomorrow.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Amir Kazemi
Posted 5 hours ago in Jira

We want to know what Jira Service Desk apps you're using!

Hi Community! My name is Amir and I’m on the Jira Service Desk product marketing team at Atlassian. Our team would love to understand how you’re leveraging our ecosystem for Jira Service Desk. Wha...

22 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