Hi Team,
I added a post function to create or clone issues, specifically to generate a subtask from a Task issue type when certain conditions are met during a specific transition. Currently, all workflow statuses are set to "All." When a ticket is moved to that status, a subtask is created, which is working as intended. However, if the user moves the ticket back to the same status, it creates another subtask.
How can we prevent the creation of duplicate subtasks for the same ticket? We only need one subtask to be created when specific conditions are met the first time the ticket moves to that status. What condition should we set to achieve this?
Hello @Lakshmi CH ,
I hope you're doing well.
Yes, you can achieve it; what you need to do is go to your clone issues post-function and edit it.
At the bottom of the screen you'll find a checkbox to add a condition using a Groovy script.
For example you can condition to only create a subtask if there is no existing subtask with the summary "Auto-generated Subtask" on the current issue.
!issue.getSubTaskObjects().any { it.issueType.name == "Sub-task" && it.summary == "Auto-generated Subtask" }
If you want to explore more about it or have other questions related to the product JMWE or any other Appfire product, just open a support ticket, and the team will be happy to help.
Thank you,
Regards,
Hector
Hi @Hector Florin _Appfire_ , Thank you for your quick response.
It's working as expected.
I slightly changed it to
(!issue.getSubTaskObjects().any { it.issueType.name == "Sub-task" && it.summary.contains("Summary wording") })
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.