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.
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.
Hello @Trudy Claspill
Thank for your quick response.
Here is the complete workflow that I was trying to automate.
This audit log refers the error when I try to include the Assignee field part of the sub-task creation.
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.
Please advice to assign different resource to each sub-task in the workflow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Will there not be a problem with parallel branch execution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Result - All sub-tasks are assigned by a same Assignee name the one that was used in last For Each branch:
Here is the audit log:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Trudy Claspill and @Bill Sheboy
Thanks to both of you for the great support in successfully resolving my first post.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.