Create a subtask for a parent issue only when it have a specific summary

Avinash Gautam December 1, 2016

Hi Jobin Kuruvilla [Go2Group]

 

I am using a Script Post function to create subtask for below scenario:

 

When a user will create a Parent issue(only a single issue type say Bug) with specific summary pattern like [Specification.Input_create test1]  then a subtask should be created with particular name.

 

I have created the script Post function but i don't know what condition should i write for the taking the summary of parent issue. Please help solve this.Condition for subtask creation.jpg Thanks!

 

--Avinash Gautam

1 answer

0 votes
Vasiliy Zverev
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.
December 1, 2016

Try this condition^ 

issue.getSummary().indexOf("[Specification.Input_create test1]") >= 0
Avinash Gautam December 1, 2016

Hi Vasiliy Zverev,

 

No Luck. I tried. I just want to say. The summary of parent issue could be something like 

Specification.Input_create test1,
Specification.Input_create for the testing,

etc

So please let me know the condition accordingly. may be i have to use a Regex but i am not been able to find that. Thanks!

 

--Avinash Gautam

 

 

 

Thanos Batagiannis _Adaptavist_
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.
December 1, 2016

In the condition field use 

!issue.isSubTask() && issue.summary ==~ regex
Avinash Gautam December 1, 2016

I am sorry but this is also not working. Please let me know if someone can give generic condition which will search parent issue summary field and then only create the subtask.

Thanos Batagiannis _Adaptavist_
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.
December 1, 2016

Avinash,

What the above condition does is, checking if the issue is not a subtask and it's summary matches the regex provided. What is your regex ?

Avinash Gautam December 1, 2016

My regex is    *Specification\.*   i wanted to match a line of summary like 

 

Specification.Input_create Input Layer data model for SAP Nord and Süd data

Vasiliy Zverev
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.
December 1, 2016

Try this: 

issue.getSummary().indexOf("Specification]") >= 0

Suggest an answer

Log in or Sign up to answer