Please tell me how can I add another specific user to the value for the multi-user field?

Evgeniy January 17, 2022

Good day. Please tell me how can I add another specific user to the value for the multi-user field?

jira automation

2 answers

2 accepted

1 vote
Answer accepted
Evgeniy January 20, 2022

Working variant, adding users to the custom field via JSON

{
"update": {
"customfield_10439" :
[{
"add": {
"name":"login1,login2"}}
]
}
}

Pat Ryan October 11, 2022

Why is this not working

{
"update": {
"customfield_10028": [{
"add": {
"accountId": "{{customfield_10149.accountId}}, {{customfield_10056.accountId}}"
}
}]
}
}

1 vote
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

Hi @Evgeniy 

You should be able to just click in the field and start typing another user's name. 

Evgeniy January 17, 2022

Apparently you misunderstood me. In this case, the Jira automation plugin is considered.

When changing a multi user field, I need to store the old value and add the new one to it. I tried to use JSON in advance, but the value is only overwritten, instead of being added.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

Perhaps if you give up the exact scenario, we can give you better guidance. What are you doing, and what do you want to happe? 

Evgeniy January 17, 2022

Point:
In the user field of the multiuser field with the existing value user 1, add user 2 using the automation plugin for Jira.

If I create an automation rule in a project and select in action - edit field
Then I can only reassign the value in this field, but I need to add the value, and not overwrite it to user2 (while deleting the past value of user1)

I tried to implement this example using JSON:

ex:

{

"fields":

{ "Multi User Customfield_11111": {{issue.parent.Multi User Customfield.accountId.asJsonObjectArray("id")}

} } }

 

{

"fields":

{ "Customfield_123456": {{issue.parent.Multi User Customfield.name.asJsonObjectArray("user2")}

} } }

 

But to no avail, my rule only removed the value.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

Thank you for the additional information. I am using Jira Cloud not Server, but I see this in my Edit issue option for a multi-user select field:

screenshot.png

Do you need see that in yours?

Evgeniy January 17, 2022

Alas, in my case, you need to statically specify a specific user who is not in this task.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 17, 2022

Gotcha. Try this in the advanced part of Editing issue in Automation:

{
"update": {
"Request participants" : [
{
"add": {
"id":"{{issue.comments.last.author.accountId}}"
}
}
]
}
}

Just sub-out your field name and which user you want to add. 

Like Evgeniy likes this
Evgeniy January 20, 2022

Working variant, adding users to the custom field via JSON

{
"update": {
"customfield_10439" :
[{
"add": {
"name":"login1,login2"}}
]
}
}

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2022

If this answered your question, can you click on the Accept Answer button above to close this one out? Thanks!

Harsh
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.
November 17, 2023

Hi @John Funk 

I have a similar requirement where I want to add and append the user picker(multi user) custom field via Automation JSON. 
I tried your above solution but it didn't work, can you help me with that.

Regards.

Harsh
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.
November 17, 2023

Update it worked I was calling the wrong field. My Bad. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events