Automation plugin: add two different users into a field.

pierre_gendre May 11, 2020

Hi,

How to automatically add two users into a field of an issue - by using the Jira automation plugin? The field being of type “list of users”.

At present, the automation works well for one user, by using the “Edit issue fields” action and then by updating the given field (the “Add to existing values” box being checked).
I haven’t found a way to add two different users. Creating two “Edit issue fields” actions sequentially doesn’t seem to work (the last user only is added to the list).

 

Screenshot 2020-05-11 at 10.10.38.png

1 answer

1 accepted

1 vote
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2020

Hello @pierre_gendre

Welcome to the Atlassian Community!

Per your description, I understand you are trying to copy all the users in the field "Access request for person" to "Request participants" when an issue is created, however, only the last user added in the "Access request for Person" is copied. Is that correct?

Performing a practical test in my own site, I was able to properly copy ALL the users configuring the same rule you did:

Screen Shot 2020-05-12 at 18.59.59.pngScreen Shot 2020-05-12 at 19.00.20.png

That being said, I suggest checking the following steps to troubleshoot it:

  1. Confirm if the field "Access request for person" is really configured as a User picker (Multiple Users).
  2. Confirm that you have added all the users to the "Access request for person" in the same issue create screen.
  3. Confirm if all the users added to the "Access request for person" are mapped as customers in the service desk project. Only customers can be added as request participants.

Let us know if you have any questions.

pierre_gendre May 13, 2020

Hi Petter,

thank you for your answer. This is not exactly what I am trying to do.
Sorry, if I missed something. Let me explain it more accurately:

An issue of type T gets the following fields:

- name: "Teamlead" type: "User" (custom field)
- name: "Access request for person" type: "User" (custom field)
- name: "Request participants" type: "Set of Users"

The rule I'd like to implement is the following:

As soon as an issue of type T is created,
the "Teamlead" value AND the "Access request for person" value (of the given issue)
should be added into the "Request participants" field.

Best,
Pierre

pierre_gendre May 18, 2020

Hi @Petter Gonçalves ,

Do you have any update on that topic?
Thank you.

Best,
Pierre

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 18, 2020

Hello @pierre_gendre

Thank you for your detailed information.

Now I understand you are trying to add users from two different custom fields to the "Request participants" field.

Indeed, adding values from two fields to a single one in the same rule will not work as expected, so you must re-fetch the issue before adding the value from the second custom field. Basically, you just need to add a re-fetch action before the second edit issue fields:

Screen Shot 2020-05-18 at 13.16.41.png

Additionally, make sure you have marked the flag to add to existing values.

Let us know if that worked for you.

Like Jessica Rutherford likes this
pierre_gendre May 19, 2020

Hi @Petter Gonçalves ,

It works well!
Thank you,
Best.


Pierre

Like Petter Gonçalves likes this
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 19, 2020

You are welcome @pierre_gendre

Have a nice day!

Bill Latham October 22, 2020

Hey @Petter Gonçalves -- I'm not seeing a way to mark the flag to add to existing values for my multi-user picker field.  Can you show where I would set it?  Thanks in advance!

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2020

Hello @Bill Latham,

The option to flag a new option without excluding the previous flagged options from a user picker field can be selected if you select to copy the field from another field, as in the example above:

Screen Shot 2020-10-28 at 13.17.44.png

If you plan to add it without copying from other field, you can use the advanced field editing as described in this documentation. In the example below, consider "user.accountid" as the raw account id of the user you would like to add in the field:

{
    "update": {
        "custom user field": [{
                "add": "user.accountid"
                  }]
              }
}

 Let us know if you have any questions.

Bill Latham October 28, 2020

Thanks -- I was hoping there was a flag somewhere I was missing.

Suggest an answer

Log in or Sign up to answer