The scenario is that I had to create multiple subtasks (Marketing Ad, Marketing Events, Marketing Analysis, etc) and assign to different individuals for a parent issue "Marketing Production". These subtasks are not created in sequential, hence the order is always different. Also, the workflow is different for each subtask as well as the end or closing status is different too.
For example:
Marketing Ad subtask has the end status as "Done",
Marketing Events subtask has the end status as "Resolved",
Marketing Analysis subtask has the end status as "Complete",...
When one subtask is complete then Jira MUST notify the assignee of the following Subtask automatically until all subtasks are marked complete.. Is this something possible using Jira Automation or a Script Runner? Any leads would be really helpful for me.
Hello @VVC
Jira has to have some information in the subtask that is "finished" that can be used to identify the next subtask to be worked.
Typically that would be done by creating a link between the predecessor/successor tasks. Are you linking each subtask to its successor subtask? Example
subtask3 "depends on" subtask2
subtask2 "depends on" subtask1
This could be handled, potentially, with Automation Rules. (It might also be handled with ScriptRunner.)
For example purposes, let us say that you have linked the subtasks together with the blocks/is-blocked-by link relationship
Rule #1
TRIGGER: When issue transitions to Done
Condition: Issue type = "Marketing Ad"
Branch: For Linked Issues - Link type = "blocks"
-- Action: Send email to Assignee
You would create a rule like that for each "finished" Status value / Issue type pair.
Thanks @Trudy Claspill for your suggestions on how to get this started.
At the moment, the subtasks are not linked together but for testing purposes, I will have the subtasks linked and try out to see if this method works best for our scenario.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Trudy Claspill When a link is added between each subtask then it's working like a charm but the pain point for our single resource is to link each subtask meticulously, otherwise this process is going to fail.
Would it be possible to link the subtask tickets automatically by comparing the each subtask ticket number and if it's just an increment by 1 then link them together?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What if tickets were created out of order?
What if, between the time the first subtask is created and the second subtask is created, somebody else creates an entire separate issue in the same project? The difference in the key numbers will not be 1 in that case.
It might be possible to work something out with automation. Perhaps retrieving all the subtasks, sorted by creation date or issue key, for a given issue and then looping through the results to link one ticket to the next. Unfortunately I don't have time to work out the details.
I recommend that you create a new Question that asks specifically about automating link creation between subtasks. That will make your question on that specific topic more visible to the wider community, and there might be somebody else that can chime in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @VVC ,
Seems you have those sub-task (or action item) in succession with another.
So, in order to have a best-approach automation or process - you should add some sort of hierarchy process OR linked process (A followed by B, Followed by C and so on).
Having that process would be easy in terms of Automation and even a view of the assignee/reporter.
Adding a label would be another beneficial case - Assume, future you want to have a time-in-status report for those action checking 'who did that in what duration of time' (Since, that's marketing, one need now or later).
Rest, you can use that via Automation as @Trudy Claspill provided already.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Piyush Annadate _ACE Pune_ for sharing your thoughts with reference to adding label. At this time, it is the job of a single person primarily, who is going to create all subtasks in Marketing Production. The order of subtasks creation is not going to be in sequence, as it is depends upon the ask in the main issue type.
If Jira system can automatically add a label of specific format each marketing subtask right after the creation of each subtasks that might be super helpful in keeping it consistent.
My thoughts, Marketing_Subtask1, Marketing_Subtask2 and so on until all subtasks are created for each marketing production issue type. Do you think automating this approach is possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's the priority @VVC ,
1. Have a customfield for those specifications.
2. Have components for those
3. Least - labels.
Based on your top level issue - automation should be able to take care of all the creation as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hell0 @VVC, If you want true dynamic behavior, ScriptRunner can handle this logic in a custom listener:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
def issueManager = ComponentAccessor.issueManager
def issue = event.issue
// Only continue if this is a subtask and moved to a terminal status
if (!issue.isSubTask()) return
def terminalStatuses = ["Done", "Resolved", "Complete"]
if (!terminalStatuses.contains(issue.getStatus().name)) return
def parent = issue.getParentObject()
def subtasks = parent.getSubTaskObjects()
// Sort subtasks based on custom sequence field (or summary if ordered by name)
def sortedSubtasks = subtasks.sort { it.summary } // replace with custom field if available
// Find index of current subtask
def currentIndex = sortedSubtasks.findIndexOf { it.key == issue.key }
// Notify the next subtask's assignee
if (currentIndex < sortedSubtasks.size() - 1) {
def nextSubtask = sortedSubtasks[currentIndex + 1]
def user = nextSubtask.assignee
// Send notification (email, comment, etc.)
def commentManager = ComponentAccessor.commentManager
commentManager.create(nextSubtask, user, "Hi ${user.displayName}, your subtask is ready to begin.", false)
}
This assumes subtasks can be ordered by a consistent field (summary, custom field, or creation time).
Subtasks belong to the same parent issue
→ All subtasks are linked under a single parent (like “Marketing Production”).
Subtasks have a definable order
→ Either:
Their summary/names follow a pattern (e.g. 1 - Ad
, 2 - Events
), or
You use a custom number field (e.g., Sequence Order = 1, 2, 3
).
Terminal statuses are known and fixed
→ You know all possible "completion" statuses across different workflows (e.g., "Done", "Resolved", "Complete").
Each subtask has a valid assignee
→ The next subtask must have an assignee to send the notification to.
ScriptRunner is installed and has permission
→ ScriptRunner must be installed and have permissions to run listeners and access the required fields.
You need admin permissions to:
Create or configure ScriptRunner listeners
Access and configure custom fields (if needed)
If you're not using the summary to define the order, create a custom field:
Name: Sequence Order (or Step Number)
Type: Number Field
Populate it manually or via automation when subtasks are created
Prepare a list like:
def terminalStatuses = ["Done", "Resolved", "Complete"]
Adjust based on the actual status names used in your Jira workflows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Shivraj Marathe , Yes I'm looking for a true dynamic behavior and I will give your script a try then let you know. Thanks again for sharing this script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hell0 @VVC, If you want true dynamic behavior, ScriptRunner can handle this logic in a custom listener:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
def issueManager = ComponentAccessor.issueManager
def issue = event.issue
// Only continue if this is a subtask and moved to a terminal status
if (!issue.isSubTask()) return
def terminalStatuses = ["Done", "Resolved", "Complete"]
if (!terminalStatuses.contains(issue.getStatus().name)) return
def parent = issue.getParentObject()
def subtasks = parent.getSubTaskObjects()
// Sort subtasks based on custom sequence field (or summary if ordered by name)
def sortedSubtasks = subtasks.sort { it.summary } // replace with custom field if available
// Find index of current subtask
def currentIndex = sortedSubtasks.findIndexOf { it.key == issue.key }
// Notify the next subtask's assignee
if (currentIndex < sortedSubtasks.size() - 1) {
def nextSubtask = sortedSubtasks[currentIndex + 1]
def user = nextSubtask.assignee
// Send notification (email, comment, etc.)
def commentManager = ComponentAccessor.commentManager
commentManager.create(nextSubtask, user, "Hi ${user.displayName}, your subtask is ready to begin.", false)
}
This assumes subtasks can be ordered by a consistent field (summary, custom field, or creation time).
Subtasks belong to the same parent issue
→ All subtasks are linked under a single parent (like “Marketing Production”).
Subtasks have a definable order
→ Either:
Their summary/names follow a pattern (e.g. 1 - Ad
, 2 - Events
), or
You use a custom number field (e.g., Sequence Order = 1, 2, 3
).
Terminal statuses are known and fixed
→ You know all possible "completion" statuses across different workflows (e.g., "Done", "Resolved", "Complete").
Each subtask has a valid assignee
→ The next subtask must have an assignee to send the notification to.
ScriptRunner is installed and has permission
→ ScriptRunner must be installed and have permissions to run listeners and access the required fields.
You need admin permissions to:
Create or configure ScriptRunner listeners
Access and configure custom fields (if needed)
If you're not using the summary to define the order, create a custom field:
Name: Sequence Order (or Step Number)
Type: Number Field
Populate it manually or via automation when subtasks are created
Prepare a list like:
def terminalStatuses = ["Done", "Resolved", "Complete"]
Adjust based on the actual status names used in your Jira workflows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Shivraj Marathe I have tried the custom listener script with the Event "Issue Closed" along with summary field with values 1 - Marketing Review and 2 - Marketing Ad on the subtasks. I'm not sure if I'm missing anything but the listener has no history yet despite few attempts in moving the subtasks to Done status. Any ideas or suggestions?
Also, I have tried replacing the Summary with Order but running into some logic issues on my side. Could you also share the updated script using a custom number field "Order"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.
Register here ⬇️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.