I need to add a post-function that creates a sub-task during transition. The key requirement is that this can only be executed once per issue. Also, because this workflow is highly complex, this post function may appear at different points in the workflow.
Is there a way to have an indicator or counter or something that the post-function will refer to before executing to ensure it is only executed once per issue?
You pretty much answered your question yourself. You need an indicatior that a sub-task has already been created by said post-function. Now the indicator itself can be pretty much anything you see most fitting for your workflow. These options come to mind:
- The very existence of a subtask, assuming no other subtasks can be present given your workflow logic.
- Some sort of custom field in your parent issue or sub-task, which is populated at sub-task creation and can be used as an indicator.
- Sub-task's summary which answeres a certain pattern. You can then check the existing subtasks' summaries agains this pattern and if one is found then it means that a sub-task has already been created by a post-function.
These are just a few ideas for how you can implement this. Hope this helps.
I appreciate your response - unfortunately, I was not clear enough in my post.
I am not as concerned about the logic as I am the script itself. I do not know Groovy, or anything comparable. I can't write the script.
Trust me, if I could do this with Automation for Jira I would, but ScriptRunner is what my client's got.
Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...
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