Parent child issues

Ganesh
Contributor
November 23, 2021

HI Community!!!

I m able to move child issues dynamically when parent is moved !!!

Ex: I m moving parent from (TODO to INPROGRESS & INPROGRESS to TODO) so child issues are behaving the same (TODO to INPROGRESS & INPROGRESS to TODO)!! to achieve this I have used this postop(

Transition related issues (JMWE app)Transition all related issues (such as linked issues, Stories of an Epic, Epic of a Story, subtasks of an issue, issues returned by a Groovy script or a JQL search, etc.)

)

However I need to put child issues to be constant when child issues moved to DONE Status!!!!

for above scenario child issue is moving (irrespective of any status) accordingly when parent is moved!!!

Can someone help me with some groovy script or any condition do I need to apply to accomplish this!!!

Thanks in advance!!!

 

1 answer

1 accepted

0 votes
Answer accepted
Sayed Bares {Appfire} November 24, 2021

Hi Ganesh,

Hope you are doing well.

To achieve your use case you just need to enable Conditional execution parameter in Transition related issues (JMWE app) post-function and add the following code:

linkedIssue.get("status")?.name != "Done"

Screenshot.PNG Hope it helps and let us know how it goes.

Best,

Sayed

Ganesh
Contributor
November 24, 2021

@Sayed Bares {Appfire}  I m good thanks!!!

Hope you are doing good!!

The answer you are suggested working absolutely fine!!! 

However I tried to add multiple statuses to it like below 

linkedIssue.get("status")?.name != "Done","Inreview","Accepted"

 It is throwing me error!!!

Could you please suggest where am doing wrong adding multiple statuses!!! Thanks in advance!!!

Sayed Bares {Appfire} November 25, 2021

Hi @Ganesh 

I am doing great thanks for asking.

To skip multiple statuses you can use the following code:

!(linkedIssue.get("status")?.name in ["Done","Inreview","Accepted"])

The reason the code you have used before didn't work is because != operator can only work with one status not multiple. But with the above, you should be able to achieve what you are trying to do.

Hope it helps and let us know how it goes.

Best,

Sayed

Ganesh
Contributor
November 25, 2021

@Sayed Bares {Appfire}  Thank you for taking your time to writing to me!!

I have tried the above code , however it is not working my cases!!!

Child in Inreview status !!! I moved parent to todo/Inprogress so it is moving back child to the same status(i,e todo/Inprogress) same case with Accepted and done!!!

Could you please suggest me some other code or modifications!!

Note: I have tried "!" and  "!=" begining of the code!!! But has no luck!!! Thanks!!

Regards,

Ganesh!

Ganesh
Contributor
November 28, 2021

@Sayed Bares {Appfire}  Could you please help me with this?

Sayed Bares {Appfire} November 29, 2021

Hi @Ganesh 

Sorry for the late reply and I hope you had a great weekend.

I have tested the code and it perfectly works. The only reason I think it is not working on your end is probably the status names are different. Perhaps you can use status IDs and see how it goes:

!(linkedIssue.get("status")?.id in ["10102","11500","11501"])

 To get the status IDs you transition to "Done", "Inreview" and "Accepted" status and then can click on Issue history:

screenshot-localhost_8080-2021.11.29-17_44_42.png

Best,

Sayed

Ganesh
Contributor
November 30, 2021

@Sayed Bares {Appfire} You are a life savior!!!! It is working absolutely fine!!!

Thank you so much!!! Keep support us!!! Thanks!!!

Like Sayed Bares {Appfire} likes this
Sayed Bares {Appfire} November 30, 2021

You are most welcome @Ganesh and glad it worked :)

Like Ganesh likes this

Suggest an answer

Log in or Sign up to answer