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?
Hi,
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.
Hi Ivan,
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see. I was under the impression that you already have a script that creates sub-tasks. Thanks for clarifying.
With that in mind if you can specify what kind of indicator you need I suppose I could help you with the coding part.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.