Problem Script Runner "Create a sub-task"

Nils Lange March 18, 2013

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 votes
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2013

> 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.

Nils Lange March 18, 2013

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?

Nils Lange March 18, 2013

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 :)

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2013

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.

Vishali
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2013

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

Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2013

Maybe you should add the following conditon

issue.subTasks.size() == 0

Cheers

0 votes
Tsol
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2013

Maybe you should add the following condition

issue.subTasks.size() == 0

cheers

Suggest an answer

Log in or Sign up to answer