How to automatically create and assign subtasks in a Jira Team project

Benjamin Pettus July 20, 2022

My team often has documents that need to be reviewed independently by multiple people. I would like to put these documents into jira tasks, then have a "People" field called Reviewers in the task that the reporter can add all reviewers to. I then needed the automation to iterate over the list entered into this field and generate sub-tasks for each person as well as assign the sub-task to them. I have gotten it to successfully generate the proper number of sub-tasks, but it does not assign them to the users listed. However, when I check the audit log it will say that it has run successfully and that the "Issue already assigned to user." I have included my configuration below.

 

Screen Shot 2022-07-20 at 10.44.05 AM.pngScreen Shot 2022-07-20 at 10.44.44 AM.pngScreen Shot 2022-07-20 at 10.57.53 AM.pngScreen Shot 2022-07-20 at 10.58.55 AM.pngScreen Shot 2022-07-20 at 10.58.12 AM.png

3 answers

1 accepted

6 votes
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 20, 2022

Hi @Benjamin Pettus and welcome to the community,

to set the assignee the accountId of the user is needed. Furthermore the forEachSmartValue acts like an iteration. So using the current value of the iteration to set the assignee will lead to success instead of using the triggerIssue.

See the screenshots below of an automation rule I tested:

image.pngimage.png

 

Hope this was helpful.

 

Best
Stefan

Benjamin Pettus July 26, 2022

@Stefan Salzl Yes, this worked well and was very helpful! Putting the ((ReviewersList)) in the assignee field was the game-changer. Thank you!

Like # people like this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2022

AWESOME!!!! Good to hear you got that working 💪💪

Like # people like this
Mayuresh Kamble July 5, 2023

Hello @Stefan Salzl ,

Hope you're doing well !

I have a question regarding this automation, is there any way we can add the name of each individual approver in summary associated with their subtask.

Regards,
Mayuresh Kamble

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 6, 2023

Hi @Mayuresh Kamble - welcome to the community,

if I got your requirement correctly: yes, this is possible.

There needs to be a change in the forEach branch as it should iterate over the 'Reviewers' field and then use the different properties (displayName for the name in the summary and 'accountId' for setting the assignee) within the branch (see screenshots below):

image.pngimage.png

I hope this is what you are looking for and it was helpful.

Best
Stefan

Like Mayuresh Kamble likes this
Mayuresh Kamble July 10, 2023

Thank You @Stefan Salzl this solution worked !

Like Stefan Salzl likes this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2023

Hi @Mayuresh Kamble 

thanks for the feedback. Great to know you got that working ;)

Best
Stefan

0 votes
Girivasan September 3, 2023

Is there any way to do this in Jira DC version 9

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 4, 2023

Automation for Jira is available in Jira DC too. tbh I‘m more familiar with the cloud version but as long as there is a forEach branch (which is the only thing I‘m not quite sure about) this should work exactly the same way.

Just give it a shot ;)

Best
Stefan

Girivasan September 4, 2023

Thanks @Stefan Salzl - There is no for each branch in the DC version, the only way to introduce iteration is through the additional fields section - But to me, looks like it support only update & fields - not any branching

Like Stefan Salzl likes this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 5, 2023

@Girivasan 

damnit. you are right :-/ could just re-check this. what a bummer.

Unfortunately I don´t see an easy out-of-the box solution like the one provided above. Maybe you could try to use a webRequest action and iterate within the payload.

Maybe the following links could be helpful regarding this topic:

https://community.atlassian.com/t5/Jira-questions/How-to-use-Jira-API-to-create-multiple-issues/qaq-p/918034


https://docs.atlassian.com/software/jira/docs/api/REST/7.12.0/?_ga=2.15474545.675557620.1538152808-65270402.1526147845#api/2/issue-createIssues

Best
Stefan

Girivasan September 5, 2023

Thanks @Stefan Salzl

All i am looking is an solution to bulk clone xray test cases along with test steps, trying to use jira automation as there is no direct solution and import is failing due to volume

 

Any solution?

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 5, 2023

@Girivasan 

ok. as your requirement obviously seems to be completly different and the OP is older than 1 year please open a new question describing your whole problem in form of a use case (where does the problem come from, what would you like to achieve/expect from the solution, like "given - when - then" description).

Best
Stefan

0 votes
Danno
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 21, 2022

@Benjamin Pettuswe use something slightly different where we have the automation assign the ticket to a reviewer or approver or whatever by a workflow step.

I've not implemented it yet in the same way you are looking for but I would think you could do it w/o using sub-tasks.

Have a multiple user picker field to collect your approvers. Use a trigger such as a Review Status (or a checkbox to trigger) so you know the issue is in review and have an automation rule that fires that will assign the issue to the first reviewer in the list. Have a loop transition that says Send to Next Reviewer for instance and have it pick the next reviewer in the list.

I use a custom user picker for each of the approval levels that only contains the users that are approved to approve for that level. Automation populates that based on who triggers the next approval to capture the actual approver.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events