We got a parent task with several sub-tasks. Is it possible in Jira Automation to send email notification to the assignee of the next sub-task when the previous task has been transitioned to Done status? How do I check if there is still remaining sub-task to be completed? And then take the assignee to be used for email notification?
Appreciate your help and instructions on how to achieve this.
There's two parts to that. The easier one is "not done" - a simple search can do that with (pseudocode) "parent = X and status not 'done'". The hard part is "next" - whilst we could add "order by" to the query to get an ordered list, you haven't defined what that is.
Assuming the order is something easy or obvious like "priorty", a custom field with a definitive order, "created time" or even "issue key" (which would al make very good sense if you're automatically creating the subtasks - code for that would create them in the same order each time or explicitly set it), then you just read the first element from the result list.
Problem there is that I do not know if Automation can do that. I know I can code it (because I have) and I'm 99.9% certain anything I can code, Scriptrunner and possibly other apps can also support that code. Just not sure of Automation here.
Thank you for the question.
I would advise you to check the issue object in the issue object which comes in the binding of the post function to get the subtasks for an issue and to get the next one to get the assignee off it. Then you will need to call the notify API to send a notification and I can confirm that the documentation example located here shows how to call this API to send an email and can be used as a reference to create the script that you require.
I hope this will help.
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