Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JMWE Groovy script

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

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

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

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

it gives me back false for some reason. 

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

 

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

f course i can do it. here is the result

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

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.

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

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

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

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

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
Community showcase
Published in Confluence

Introducing External Collaboration for Confluence

We’re excited to introduce external collaboration for Confluence, now available in early access. It is available to preview for Confluence Cloud Premium and Enterprise customers. (If you're not on ...

230 views 0 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you