Forums

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

How to set Select List field in Automation using JSON

William Tanner July 11, 2024

I have an automation rule that creates a new Jira issue.  There is a required field that is a custom field of type select list (single).  I have to use JSON to set the value in the automation rule.

Every time I run the rule, I get an error indicating the custom field is required.  But, that is the custom field I am trying to set with the JSON.  Is there something wrong with my JSON?

 

Here is the error:

 

Error creating issue
Team Org is required. (customfield_11228)
Here is the JSON:

{

"fields": {

"customfield_11228": { "value": "AST Advance Sustainment Technology" }

}

}

1 answer

1 accepted

0 votes
Answer accepted
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.
July 11, 2024

Hi @William Tanner 

Please check your Create Issue action in the rule to see if you selected both the field from the dropdown list and tried to set it with JSON.  That can cause that symptom as only one may be used at a time.

If that is not the cause, please post images of your complete automation rule, the Create Issue action, and of the audit log details showing the rule execution.  Those may provide context to help explain this symptom.

Kind regards,
Bill

William Tanner July 11, 2024

Hi @Bill Sheboy 

Thanks for the reply.  I confirmed that the custom field is not selected from the dropdown list.  I don't see it as an option, which is why I am using JSON.

Here is the automation rule:

Automation Rule.png

 

 

And, here is the error from the Audit Log

 

Automation Rule Error.png

Like John Funk likes this
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.
July 11, 2024

Is that field on your create issue screen for that issue type?

William Tanner July 12, 2024

I determined that the field is actually from a plugin, either Multi-Level Cascading Select or Dynamic Forms for Jira.  It only goes to the second level (like a cascading select field) if you choose an option other than the one I am trying to set, which is why I didn't realize it was not a standard select list field.

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.
July 12, 2024

Ah, that helps clarify things!

Some addon / plugin fields are not supported by automation rules as they are dynamically generated.  To check if your field can be set by a rule, please use this how-to article to find the apparently supported fields for automation: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

The basic steps are:

  • identify an example issue with your field
  • using a browser tab, call the REST API to examine the issue
yourJiraURL/rest/api/3/issue/yourExampleIssueKey?expand=names
  • search for your field on the page
    • if you find it, it appears to be supported
    • if you do not, it is likely not supported

 

If it was there and is a cascading field, here is the syntax to set the values using JSON:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Cascading-select-custom-field

William Tanner July 12, 2024

@Bill Sheboy thanks for the info.  I can see the field in the page you referenced above.  I have opened a support ticket with the Deviniti folks to see if they can provide some help.

automation rule field.png

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.
July 12, 2024

Ah...now search on the page for "customfield_11228" to see if it has a value further down the page.  That will show the format to set it, when possible.

Like DENIS Pascal likes this
William Tanner July 12, 2024

@Bill Sheboy your help has been fantastic!  Based on your last comment, I was able to identify the ID of the select value: 16483.  I changed my JSON to use the ID and not the "value" and it worked.

For the record, here is the JSON:

automation successful JSON.png

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.12.6
TAGS
AUG Leaders

Atlassian Community Events