Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,558,757
Community Members
 
Community Events
184
Community Groups

Prevent subtask creation if subtask of same type already present

I have several subtasks that are created on transition, but occasionally the parent issue will be moved to a previous status and then back. This causes the subtask to be created again. I am trying to create a condition in the post function to prevent execution if there is already a subtask of that type present. I've seen solutions for Scruptrunner for JIRA server but am in search of a solution for Scriptrunner for cloud. 

1 answer

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 09, 2019

Hi Humberto,

Thank you for your question.

So that i am able to advise further on on your requirement, can I please confirm how are you creating the subtasks, are you using the *Create Subtask* workflow function provided by ScriptRunner for Jira Cloud or have you created your own script to create the subtaks?

Regards,

Kristian

Hello,

I am using the built in Create Subtask post function from Scriptrunner

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 09, 2019 • edited

Hi Humberto,

Thank you for this.

I can confirm that the way to achieve this would be to set a field on the parent issues such as a checkbox on the subtask when it is created.

You would then be able to condition to the *Create Subtask* function in order to check if the checkbox value was set and only to create the subtask when the value was not set. 

I can confirm that we have examples of how to extract and set different types of fields in the documentation pages here and we have details of how to create conditions for the post function in the documentation page here and that you will be able to use these as reference guides to help you achieve your requirement.

I hope this helps.

Regards,

Kristian

Thanks for your help. I was hoping for a way to look through the subtask types and block based on whether a type already existed. This workaround should work though. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events