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
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
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

361 views 0 6
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