How to automate creation of issues based on a custom assignee list
Asked by LENA BURLAK:

We would like to create issues automatically based on a certain list of users and assign it to them.

Based on some internet ideas we've Created a smart value list in automation

{{AissgneeList}} as {{"User1,User2"}}, the users are hardcoded for now for testing purposes, also not sure how to get project or group user's list for automation.

After that we are creating a branch based on AssigneeList.split(",") with variable Person in two steps

1. Create an issue and

2. Assign issue to variable {{Person}}

The automation creates only two issues, not 4, and does not assign the issues to users.

Any help to what is possible to do?

![automation2.jpg](/t5/image/serverpage/image-id/346155i28825AC8A53D096D/image-size/large?v=v2&px=999 "automation2.jpg")![automation1.jpg](/t5/image/serverpage/image-id/346154iC88443FD31324048/image-size/large?v=v2&px=999 "automation1.jpg")


Answers:
author: Bill Sheboy
body: Hi [@LENA BURLAK](/t5/user/viewprofilepage/user-id/5528041) -- Welcome to the Atlassian Community!

Your rule will need some changes to work with a user list...

First, **I do not believe Jira Cloud automation rules can use the user's display name to assign issues**. Instead the account id value must be used. There are several ways to solve this:

* Include the account id value in the rule
  * As you are already hard-coding the display names, you could substitute the account id values, or use a Lookup Table so both values are present in the rule. For example, with some made up account id values:
    * action: Create Lookup Table
      * variable name: tblAssigneeList
        * row
          * key: Jane Doe
          * value: 12345-abcd
        * -ow
          * key: John Doe
          * value: 67890-efab
  * This approach will help you get your rule set up quickly and it may be improved to another method next
  * One risk with this approach is typographic entry errors and the maintenance for changes to either value (or the list)
* Assume there exists at least one issue already assigned to each person, and...
  * Use the Lookup Issues action with JQL to search on the display name for a matching assignee issue, and then use the accountId attribute for that issue in the new Story assignment
* Dynamically get the account id value using the REST API
  * Use the Send Web Request action to get / search for the user, and use their account id value from the {{webResponse}} smart value in the assignment

Next, I recommend **adding a prefix to the names of variables** (e.g., created or in a branch), such as with varPerson. This will reduce the risk of collisions with built-in smart value names.

Next, to **create a list for the branch looping, the curly brackets and quotation marks are not needed**. In your example it might look like this:

* action: create variable
  * variable name: varAssigneeList
  * smart value:

```
Jane Doe, John Doe
```

Please note well the use of a ***comma followed by a space as a delimiter***. This helps make the list more readable, and must be accounted for in the branch:

* advanced branch:
  * smart value: {{varAssigneeList.split(", ")}}
  * variable name: varPerson

The alternative is to change the delimiter between names to only be a comma (or use the Lookup Table mentioned earlier).

Kind regards,  
Bill


Tags: cloud

jira-cloud