How to set Select List field in Automation using JSON
Asked by William Tanner:

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" }

}

}


Answers:
author: Bill Sheboy
body: Hi [@William Tanner](/t5/user/viewprofilepage/user-id/5245752)

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

comments: author: William Tanner
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)

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](https://community.atlassian.com/t5/image/serverpage/image-id/335116i0C22CA60F6198316/image-size/large?v=v2&px=999 "Automation Rule.png")

And, here is the error from the Audit Log

![Automation Rule Error.png](https://community.atlassian.com/t5/image/serverpage/image-id/335119iA0C9635965938768/image-size/large?v=v2&px=999 "Automation Rule Error.png")


author: Bill Sheboy
body: Is that field on your create issue screen for that issue type?


author: William Tanner
body: 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.


author: Bill Sheboy
body: 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>


author: William Tanner
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) 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](https://community.atlassian.com/t5/image/serverpage/image-id/335358i37F386B8D51BF99B/image-size/large?v=v2&px=999 "automation rule field.png")


author: Bill Sheboy
body: 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.


author: William Tanner
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) 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](https://community.atlassian.com/t5/image/serverpage/image-id/335360iECB8A9E7D0FFC1E0/image-size/large?v=v2&px=999 "automation successful JSON.png")


Tags: data-center

jira-data-center

jira-server

server