Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to I set a custom group picker field to a user group in JIRA Automation

Kathi Paquet
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.
June 2, 2021

I want to set a custom field (group picker field - single group) to a particular user group.

My automation looks like this:

{
"fields": {
"customfield_10140": {"id":"35911a95-667e-4fb6-a5e5-9b4550ce1cc7"}

}
}

Error:  (Unrecognized field "id" (Class com.atlassian.jira.issue.fields.rest.json.beans.GroupJsonBean), not marked as ignorable at [Source: N/A; line: -1, column: -1] (through reference chain: com.atlassian.jira.issue.fields.rest.json.beans.GroupJsonBean["id"]) (customfield_10140))

When I tried this: 

{

    "fields": {

           "customfield_10140": {{"id": "35911a95-667e-4fb6-a5e5-9b4550ce1cc7" }}

        }

}

I get the error:  

(Can not deserialize instance of com.atlassian.jira.issue.fields.rest.json.beans.GroupJsonBean out of START_ARRAY token at [Source: N/A; line: -1, column: -1] (customfield_10140))

 

Can someone help me with the context?

2 answers

1 accepted

0 votes
Answer accepted
Kathi Paquet
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.
June 2, 2021

This is very strange... now all of sudden I can see my custom field within the Edit Issue.  I didn't see it before and was trying to set the value within the Advanced.  So no issues and resolved!

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.
June 2, 2021

Hi @Kathi Paquet 

I am glad to see you figured it out.  For future reference, please take a look at this documentation page; it shows examples similar to what you were trying to do:

https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

Best regards,

Bill

Ksenia Abdulina January 25, 2023

Hi Bill! 

This reference you gave is almost enough. I didn't find there how to update custom field: Group picker... 

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.
January 25, 2023

Hi @Ksenia Abdulina 

Do you mean a multi-user selection like this: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-user-picker-custom-field

Or something else?

Kind regards,
Bill

Ksenia Abdulina January 26, 2023

Hi @Bill Sheboy 

No, I'm trying to execute the exact thing that is in the original request: 

"I want to set a custom field (group picker field - single group) to a particular user group." 

When I tried this: 

{

    "fields": {

           "customfield_10620": {{

           "value": "DLS_JIRA_AXO" }}

        }

}

I still got an error in my automation rule. 

How can I find the id of a group as it shown in the original Kathi request? 

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.
January 26, 2023

There are several ways to do this.  First find an example issue which uses that field, and then:

  • Try an advanced search and issue export, including all fields.  Look in the results to find the id.  If that does not work...
  • Use this how to article to learn both the id and the correct structure in JSON to set the field: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/  Please not that if you do not see the field with this method then it is most likely not supported by automation rules
1 vote
Cooper Latham
Contributor
May 3, 2023

Here is the JSON structure that worked for me... Hope this helps!

 

{
    "fields": {
        "customfield_xxxxx": {
            "groupId": "insert-group-id-here"
        }
    }
}
Tomas Slavkovsky
Contributor
May 22, 2023

@Cooper Latham, yes, this works! Thanks. Here is a JSON if you have multiple group selection field and want to add a group (not owerwrite current one):

 

{
"update": {
"customfield_10xxx": [
{
"add": {"groupId":"xxx-xxx...xxx"}
}
]
}
}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events