Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE Groovy script

Jurica Petricevic
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.
May 19, 2021

Hi there once again,

is there a way to block one subtask transition, to be invisible until the main ticket reaches a certain status?

Best regards

Jurica

2 answers

1 accepted

2 votes
Answer accepted
Suprija Sirikonda _Appfire_
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.
May 19, 2021

Hi @Jurica Petricevic ,

To hide a transition on sub-task based on the status of it's parent ticket, you can use "Related Issues Status Condition (JMWE app)" condition on the desired transition of the sub-task workflow and configure it as shown below : 

 

JMWE Condition.png

 

Alternatively, you can add "Scripted (Groovy) Condition (JMWE app)" condition on the desired transition of the sub-task workflow and add the below groovy script : 

issue.parentObject?.status?.name == "In Progress"

Replace "In Progress" with the required status name of parent issue.

 

Thanks,

Suprija

Jurica Petricevic
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.
May 19, 2021

i have tried the same but it does not work for some reason. Any tips?

Suprija Sirikonda _Appfire_
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.
May 19, 2021

Hi @Jurica Petricevic ,

Are the tickets related through default parent - subtask relation? or are they related to each other through any issue ink?

Can you test the scripted groovy condition for the affected sub-task and check if it returns true

 

JMWE Test.png

 

Thanks,

Suprija

Jurica Petricevic
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.
May 19, 2021 edited

it gives me back false for some reason. 

both types are our own handmade and are in a Parent-child relationship.

 

Suprija Sirikonda _Appfire_
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.
May 19, 2021

Hi @Jurica Petricevic ,

1. By "Parent-child relationship" - do you mean the default parent-subtask relationship of Jira or relation through any third party add-on?

2. Test the below script for the sub-task (I suppose PFDT-173 is the sub-task) and post the result here : 

issue.parentObject

3. Can you share a screenshot of the sub-task issue view showing the relation to the parent?

Thanks,

Suprija

Jurica Petricevic
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.
May 19, 2021 edited

f course i can do it. here is the result

Suprija Sirikonda _Appfire_
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.
May 19, 2021

Hi @Jurica Petricevic ,

From the screenshot, I understand that PFDT-177 is a sub-task and PFDT-176 is it's parent issue.

If current status of PFDT-176 is not "In Umsetzung"(as configured in your script) then the script returns false and the transition where you have added this condition will be hidden on the sub-task PFDT-177.

Now, why do you think it doesn't work? Is the transition's visibility on sub-task not as expected? 

Thanks,

Suprija

Jurica Petricevic
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.
May 19, 2021

simply, this option does not work. No matter what I did the transition to subtask is always shown. no matter what status the main ticket is in, this Transition is always visible.

Suprija Sirikonda _Appfire_
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.
May 19, 2021

Hi @Jurica Petricevic ,

Are you adding this condition script on the desired sub-task transition(which you want to show/hide based on the status of parent) ? Have you published the workflow and is the sub-task using this workflow?

Thanks,

Suprija

Jurica Petricevic
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.
May 19, 2021 edited

Proof of all of the above can be found here. Everything is done correctly.

Suprija Sirikonda _Appfire_
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.
May 19, 2021 edited

Hi @Jurica Petricevic ,

I noticed you have selected "Any of the following Conditions" in the Conditions tab of the workflow - which means the transition will be shown if any one of the added three condition returns true 

JMWE Conditions Tab.png

If you want to show the transition only if all the three conditions return true then select "All of the following conditions" in the Conditions tab. Or you can also group and nest conditions, based on your requirement.

Thanks,

Suprija

0 votes
Jurica Petricevic
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.
May 19, 2021

@Suprija Sirikonda _Appfire_ thank you very much for staying with me until we find a solution. It works perfectly when you tell me what to look out for.

Suprija Sirikonda _Appfire_
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.
May 19, 2021

Hi @Jurica Petricevic ,

I'm glad it works! Have a great day :)

 

Regards,

Suprija

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.

Register today!
AUG Leaders

Atlassian Community Events