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?
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{subtasks.assigner.accountId}} isn't working - that's the issue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm glad I could help.
Please consider clicking the Accept Answer button to mark your post as Solved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.