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

> 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
Community showcase
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,531 views 15 21
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