Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Trying to populate a multi-user picker custom field with members of a JIRA Group

Michael Russo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 19, 2023

Objective:

I'm trying to populate the members of a Jira managed Group into customfield_10031, which is a multi-user picker field.

 

 

Here's my attempt to code a JIRA Automation Rule, manually triggered on a single ticket:

{
"set": {
"customfield_10031": [
{% for member in groups['00000000-bcdd-408d-af9d-f3d7a2cf8421'].members %}
{ "name": "{{ member.key }}" }{% if not loop.last %},{% endif %}
{% endfor %}
]
}
}

The ID is the ID of the group extracted from the URL in Admin / Group management.  This is a Jira/Atlassian group, not another custom field.

When I run this on an issue manually, I just get this error in Automation audit log:

Error while parsing additional fields. Not valid JSON.

I then tried:

{
"set": {
"customfield_10031": {
"set": [
{
"name": "{{groups['00000000-bcdd-408d-af9d-f3d7a2cf8421'].members | map(attribute='key') | join('},{\"name\":\"') | replace(' ','')}}"
}
]
}
}
}

 Slightly different error: 

No fields or field values to edit for issues (could be due to some field values not existing in a given project).

The field is definitely added to the screen for the issue and request type.

 

Help would be greatly appreciated!

1 answer

0 votes
Agraj Mangal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 23, 2023

Hi @Michael Russo 

IIRC the advanced field json you can either use `update` or `fields` https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Format-of-the-JSON 

Can you try updating your JSON to 

{
"update": {
"customfield_10031": {
"set": [
{
"name": "{{groups['00000000-bcdd-408d-af9d-f3d7a2cf8421'].members | map(attribute='key') | join('},{\"name\":\"') | replace(' ','')}}"
}
]
}
}
}
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.
March 4, 2024

Hi @Agraj Mangal 

Getting the error -Invalid Update operation.

Suggest an answer

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

Atlassian Community Events