Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA Cloud Automation - Sub task creation and assignment

nagendra April 10, 2025

I am trying to create automation script to create few sub-tasks and assign each of them to different resources. However, I am able to create sub-task but when I add Assignee field to the sub-task creation time it is throwing error.

So, I tried to create next step and used Assign to a resource, then it is assigning to the main story instead of sub-task.

I also tried with For Loop, but it is assigning the same resource name to the all sub-tasks.

please help.

bug workflow.png

 

 

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
April 10, 2025

Hello @nagendra 

Welcome to the Atlassian community.

We cannot help you debug an error until you show us:

1. The details of the Create Work Item action where you are creating the subtask and trying to set the Assignee

2. The details of the audit log when the rule runs. Make sure to click all the ">" character that appear on the right side of the audit log to expand all the details in the log.

nagendra April 10, 2025

Hello @Trudy Claspill

Thank for your quick response.

Here is the complete workflow that I was trying to automate.

bug workflow.png

This audit log refers the error when I try to include the Assignee field part of the sub-task creation. 

Audit Log2.png

This auditor log was successfully executed when I tried using For Each loop. However, it will assign the resource name (given in the last sub-task creation) to all sub-tasks.

Please note here I am creating multiple sub-tasks. whatever assignee name provided in the last sub-task creation, the same name was assigned to all the sub-tasks. 

Audit Log3.png

Please advice to assign different resource to each sub-task in the workflow.

 

Trudy Claspill
Community Champion
April 10, 2025

Thank you for the additional information.

The issue being reported in the first log indicates that the rule cannot set a field (Assignee) that doesn't appear on the Create Work Item screen for the work items being created 

If you can add the Assignee field to the screen that is displayed for the Create Work Item operation, then the rule should succeed.

Like # people like this
nagendra April 11, 2025

Thank you for the clarification, I will check with enterprise admin team on that.

However, I want to check is there anyway to achieve this one?

I mean, in first step issue will be created and next step resource assignment can be done for each sub-task(each sub-task different assignee)? As I mentioned with For loop it is happening but it's updating last assigned resource for all previous sub-tasks in this flow.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2025

Hi @nagendra 

Another approach is after the issue is created, add a branch to most recently created issue and assign from within the branch.  Repeat that for each issue created.

That approach only works when the rule is not already inside of a branch and the rule is short enough to allow adding the extra steps.  A better approach is adding the Assignee to the Create Issue screen, as @Trudy Claspill suggested.

Kind regards,
Bill

Trudy Claspill
Community Champion
April 12, 2025

@Bill Sheboy 

Will there not be a problem with parallel branch execution?

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 12, 2025

Hi, @Trudy Claspill !

Branches which process one-and-only-one issue are run serially in the same process so there is no problem with the updates.  For example, branches to: current issue, most recently created, and parent.  And, at some point in the last 18 months or so, Atlassian also changed the JQL branch to run serially when it is certain there is only one issue before it runs (e.g., key = ABC-123).

All the other branch types / situations run in parallel using separate processes, and so would have problems as you describe.

Kind regards,
Bill

Like Trudy Claspill likes this
nagendra April 13, 2025

Hi @Bill Sheboy and @Trudy Claspill 

As I informed in my first query, when I create a branch (For Each: Add a branch) and use Assignee, it will update all previous sub-tasks also with the last used assignee name only.

Here are the details.

Automation rule flow:

Automation rule flow.png

Result - All sub-tasks are assigned by a same Assignee name the one that was used in last For Each branch:

Sub-tasks list.png

Here is the audit log:

Audit log 4.13.png

So, as a workaround, I have added a IF..THEN condition and verified for un-assigned sub-task and then assignee it. However, the problem in this approach is, it assumes all sub-tasks will be assigned a resource at the time of creation. Whereas in my case, only few sub-tasks can be assigned default, others will be picked by the different members in the team.

Please advice.

NOTE: The issue create template update seems not possible (at least for now) as it is at enterprise level at my company.

Trudy Claspill
Community Champion
April 13, 2025

Hello @nagendra 

You did not create the branch correctly.

The branches you created are For Each: Sub-task

As @Bill Sheboy instructed, they need to be For Each: Most Recently Created Work Item

Screenshot 2025-04-13 181501.png

Like # people like this
nagendra April 13, 2025

Hi @Trudy Claspill and @Bill Sheboy 

Thanks to both of you for the great support in successfully resolving my first post.

Suggest an answer

Log in or Sign up to answer