Add a specific user to a custom field

Ida Giersing April 4, 2024

I have a custom field called "Freelance Linguists" which has the ID Customfield_10118.  The field is a multi-select People field. I'm trying to add a specific user to the field (and not overwrite users also selected there) but the below is not working. Can anyone tell why? 

Thanks!

 

{
"update": {
"Customfield_10118": [
{
"add": {
"id": "4135de02-8374-4828-a758-4cb1e1939d69"
}
}
]
}
}

3 answers

0 votes
Ida Giersing April 5, 2024

I got this work! 
Turns out the User ID was formatted wrong. 

Sorry for taking your time!

0 votes
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.
April 4, 2024

Hi @Ida Giersing 

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

It appears your syntax is correct for a multiple select, user field:  https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field

You note this is a People field, and not a User field: there are definitely differences in behavior between those.  Seeing your rule and audit log may help to narrow down the cause.

Kind regards,
Bill

Ida Giersing April 5, 2024

Sorry for not providing more context. 

The trigger is "New issue created" and then the automation looks at the description of the issue and checks whether it contains "French". 

The first Action contains this: 

{
"update": {
"customfield_10111": [
{
"add": {
"value": "French (fr-FR)"
}
}
]
}
}

This action also updates the content of a multi-select field and selects "French (fr-FR)" in that field. This part of the automation works like a charm.

I'm then trying to add another Action step to add a specific Jira user to a field called "Freelance Linguists" – still based on the presence of "French" in the description. This second Action step contains this: 

{
"update": {
"customfield_10118": [
{
"add": {
"id": "4135de02-8374-4828-a758-4cb1e1939d69"
}
}
]
}
}

The user ID is the ID of our French freelancer, so that's the person who needs to be added to the multi-select People field. 

I'm working in Jira Work Management, and don't see options for a User field vs. a People field. I only see the option for a People field, so that's what this field is. 

I hope this helps and that maybe someone out there can point me in the right direction :) 

Thank you and have a wonderful weekend!

Ida Giersing April 5, 2024

Here's a glimpse, if it helps...

Screenshot 2024-04-05 at 10.33.02.png

Ida Giersing April 5, 2024

And here is a screenshot of the audit log.Screenshot 2024-04-05 at 10.45.51.png

0 votes
Jeroen Poismans
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 4, 2024

Hi,

Not sure if this is going to be the fix but can you try without capital C of customfield_10118?

Jeroen

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events