Create and Assign Subtasks Based on JQL

JM Hoskinson December 19, 2024

I'm trying create an automation that will create an issue then create and assign subtasks based on information that's returned from JQL. I've got the whole automation to work including creating subtasks, but I'm running into problems assigning the subtasks because lookupIssues.assignee.accountId isn't available as a value. Any workaround ideas?

2 answers

0 votes
JM Hoskinson December 20, 2024

Here are some screenshots.

The branch loops through the items returned from the Lookup Issues action, adding the information from the Create Issues screenshot. I can't get the Assignee to fill in with the assignee from the Lookup Issues action, and, reading the documentation, it looks like LookupIssues.assignee.accountId isn't available as a returned value when you use the Lookup Issues variable.

Screenshot One.pngScreenshot Two.pngCreate Issue.png

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2024

Hello @JM Hoskinson 

To enable us to advise you on how to change the rule, please provide the following:

1. Screen images that show the entire rule.

2. Details of the step where you are trying to set the Assignee of the subtask

We made need to ask follow up questions after we see that data.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2024

The image you provided shows that you are using {{subtasks.assigner.accountId}}

Is that working for you?

The value you originally suggested would not work because {{lookupIssues}} is a list, and the way you used the value Jira could not tell which issue in the list you wanted to reference to get the value.

JM Hoskinson December 20, 2024

{{subtasks.assigner.accountId}} isn't working - that's the issue

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2024

Does {{subtasks.key}} work in the summary?

Have you added a log action in your loop to confirm that {{subtasks.assignee.accountId}} returns a value?

What is the output in the rule Audit Log for the step where you are trying to create the subtask?

What are the details of your For Each step?

If your For Each step looks like this, then {{subtasks.assignee.accountId}} should return a value, and will work to set the Assignee field on the new issue based on my testing.

JM Hoskinson December 20, 2024
  1. Yep {{subtasks.key}} works in the summary - the action loops through all the unique keys and creates a subtask for each.
  2. I didn't use the log action, but {{subtasks.assignee.accountId}} does not return a value. Instead of a log, I just added it to the description of each subtask. It was always null.
  3. Screenshot of most recent audit log below. No errors
  4. For Each step screenshot at bottom

Screenshot 2024-12-20 161356.png

Screenshot 2024-12-20 161545.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2024

Do the issues found by the Lookup Issues action have values in the Assignee field?

What are the project Types of the issues retrieved by the Lookup Issues action?

What is the project Type of the project where you are creating the new issues?

I tested my suggestion against a single project scoped rule where the project was a Company Managed project and it worked when the issue found by the Lookup Issues action had a value for a valid, active user in its Assigned field.

JM Hoskinson December 20, 2024

Welp - your first question is the issue... All the issues were unassigned, so the automation is actually working. Looking at the issue history, my automation seemed to unassign them all during a test. I after assigning the test issues back to users, it works like we want.

Thanks!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2024

I'm glad I could help.

Please consider clicking the Accept Answer button to mark your post as Solved.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events