Problem Script Runner "Create a sub-task"

Hello

I use the script "Create a sub-task" at one post functions.

Condition: cfValues['abc']*.value.contains("X")

Additional issue actions: issue.summary += ' - X'

The description contains "Will optionally reopen a matching sub-task", but this does not work! Everytime I perform the transition, the script creates a subtask although it exists.

Is it a generally problem when I change the summary at additional action? Or is there an workaround for this bug?

regards Nils

2 answers

1 accepted

0 vote

> Everytime I perform the transition, the script creates a subtask although it exists.

It tries to reopen a subtask with the provided summary, yet you are appending some string to it. What does "subtask summary" field look like, does it include your "- X" ?

For this feature to work you have to set the subtask summary to some known string, not inherit from parent, otherwise how could it know which one to reopen?

A screenshot of the params would be useful.

Checkbox options: y, x, z

Taskname: "parent"

Subtaskname: "parent - X" -> Like the additional action

issue.summary += ' - X'

The script creates everytime a subtask with the name above. What does the script check, the name?

Now I know what you meant. The scripit can check/reopen Subtasks when you use the script field "Subtask Summary". The script just check the "Subtask Summary" with the subtasksnames. So I have to change the script :)

Yep, exactly... you need to specify the "subtask summary" field for the reopening to work. It's designed for when people want a finite list of simple sub-tasks like "Approval", "Analysis" etc. The code is pretty straightforward.

Jamie,

I have created a listener to create sub-tasks when issue is updated. Everytime I perform the issue update, the script creates a subtask although the sub-task exists. Is there a way that I can limit the sub-task creation to once?

Thanks,

Vishali

Maybe you should add the following conditon

issue.subTasks.size() == 0

Cheers

Maybe you should add the following condition

issue.subTasks.size() == 0

cheers

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
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

243 views 1 18
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