Script Runner - Creating Subtasks with Parent Summary is not idempotent

Version: JIRA v6.3.15

Using Script Listener, I am successfully able to create subtasks based on the following condition, where my custom field is a multi-checkbox field with multiple selections possible.

'Foo' in cfValues['MyField']*.value && changeItems.any {
	it.get('field')=='MyField'
}

When the "Subtask Summary" field was filled out to a constant value (e.g "My Subtask Summary"), the subtasks are created idempotently. 

However, adding the following script to "Additional Issue Actions" causes each update to the parent ticket to create a new Subtask instance, even though the checkbox option(s) selected have not changed:

issue.setSummary("Subtask for: " + sourceIssue.summary)

I would expect this block to have the same idempotency as the static "Subtask Summary" field in the Script Listener configuration.

 

Is there a way to create subtasks only when an individual checkbox value in a multi-checkbox has changed?

 

 

1 answer

0 vote

The matching of existing subtasks is based solely on the configured summary, so if you modify it in the additional code section, it will create new subtasks.

It's intended for fairly simple use cases such as creating subtasks for Analysis, Design, etc.

If you need to use a computed subtask summary then you will need to roll the thing yourself, which is pretty straightforward to be honest.

That's good to hear, thanks for your response Jamie. Do you know of an example you could link me to of a similar computed subtask summary or some related docs? 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

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