Iterate over csv field of user account ids, create issues for each, set Assignee

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.
October 29, 2024

The requirement: I am trying to create an Automation rule that will automatically create issue under an Epic when the Epic is created. I want to create an identical set of issues for 1..n Assignees.

The target project type is Company Managed Software. I am on a Free subscription.

For testing purposes I have set the rule trigger to be Manual rather than triggering by Epic creation, and I'm creating just one issue. I'm using two users for the test.

I created a Variable in the Automation rule to create a comma separated list of Account IDs.

I'm using a Smart Value branch to iterate over that Variable.

In the branch I create the issue and set the Assignee as part of the Create Issue action.

The problem is that the Assignee is not changing from one iteration of the branch to the next. All created issues end up with the same Assignee.

 

I have tried setting the Assignee by selecting the Assignee field to set and setting it to the branch smart value, and by using JSON in the Advanced Editing option.

I got the account IDs by looking up the users through the Team feature and pulling the IDs from the URL. I have double checked that the IDs are correct.

I have tried swapping the order of the IDs in the Variable. In both cases the user is set to user 53...a0, regardless of whether it is first or second in the variable.

I have confirmed that both the users I've specified in the variable can be manually assigned to issues in the target project. There is no automatic setting of Assignee for the project via a Default Assignee setting nor are Components being used.

I am writing the branch variable into the Description field also so that I can confirm which value is in focus of the branch when the issue is created.

I have checked the History entries for the issues. The Assignee is not being modified after the Creation is completed.

Below is my rule, details of the steps, and the output of the rule execution.

Any idea why the Assignee is not being set as expected? Thanks in advance!

 

Screenshot 2024-10-29 at 12.18.08 PM.png

Screenshot 2024-10-29 at 12.19.12 PM.png

Screenshot 2024-10-29 at 12.20.29 PM.png

Screenshot 2024-10-29 at 12.21.15 PM.png

 

Screenshot 2024-10-29 at 12.27.28 PM.png

Screenshot 2024-10-29 at 12.29.40 PM.png

1 answer

1 accepted

2 votes
Answer accepted
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.
October 29, 2024

Hi @Trudy Claspill 

I have not been able to recreate that symptom. 

Instead, my test rule was able to successfully assign the issues during issue create (with same project / type as trigger) using either the branch variable directly in the Assignee field or with JSON.  This also worked for Epics and Story level issues, and with different rule triggers (e.g., Scheduled and Manual)

  • If you scroll up in your Create Issue action, is the Assignee field perhaps selected and used in the JSON?  If so, it may be getting conflicting values for the field from the JSON.
  • Which user is the actor for your rule?  I left mine as the default of Automation for Jira user.
  • If not those things, have you checked if the rule is "glitched" by recreating it from scratch?

Kind regards,
Bill

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.
October 29, 2024

Thank you for trying this out, @Bill Sheboy 

The actor for the rule is "Automation for Jira".

I updated the Create Issue action to remove the JSON and set the Assignee field directly with a Smart value.

Screenshot 2024-10-29 at 2.25.52 PM.png

The JSON shown is just the default text shown when you open that dialog and haven't entered your own code yet.

I ran the rule again and the result was the same; all issues assigned to the 53...a0 user though the Description field shows a different account ID for one of the issues.

I recreated the rule from scratch. Same result on the new rule.

 

When you tried to recreate this, did you enter your comma separated values directly in the Create Variable action? I notice that it says that a smart value is supposed to be used. I'm not sure that I've ever tried to directly enter a value for the variable rather than referring to a smart value elsewhere that held the value.

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.
October 29, 2024

Yes, I just copy-and-pasted in the values as that is a technique to hard-code values in rules using variables.

 

Hmmm...your audit log clearly shows there are no leading / trailing spaces for the values that could break the assignment.

If you look at the issue history for the created issues, is anything else perhaps re-assigning the issues?

Like Trudy Claspill likes this
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.
October 29, 2024

The only entry in the History tab for each issue is the entry noting it was created by Automation for Jira.

I love these problems where it seems that people are doing the exact same thing, and yet it works for one and not the other. :-D

I'm open to other suggestions to accomplish this.

I started exploring this because of another post that I was trying to answer:

https://community.atlassian.com/t5/Jira-questions/How-can-i-make-taks-for-an-epic-for-specific-users/qaq-p/2853654

Maybe the solution would work for that user, and my failure is a weird one-off.

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.
October 29, 2024

I just tried with a default assignee for the project to see if there was an edge case here.

I'm stumped why this is different for your rule, unless there is some intermittent problem happening in the rules engine for advanced branch.  When that feature was first introduced, there were cases where it would not loop over all values when certain actions were used inside the branch (e.g., create variable).  That was fixed a couple of years ago.

Have you tried using your super, community leader powers to ping the Atlassian team and see what they say?  :^)

Like # people like this
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.
October 29, 2024

Not yet. I wanted to reach out to the community first, in case I was missing something that would be obvious to somebody else.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 29, 2024

I just tried it on my free instance and was not able to reproduce it either. It created the issues correctly with two different users based on the initial userList variable. 

I assume if you manually create an issue it will not set the assignee if you leave it unassigned correct?

Like # people like this
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.
October 30, 2024

Oh, bother!

When I manually create an issue in the project and leave the Assignee field set to "Automatic" it is assigning the issue to the same user.

Initially that didn't make sense. There are no Components set for the issue, and at the Project level the Default Assignee is "Unassigned". And then I looked at the Create transition in the Workflow, and found that a Post function is setting the Assignee.

Thank you everybody for your help!!

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events