Forums

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

JSON syntax errors in automation

Vamsi Krishna Panthulu August 18, 2023

hi All

 

I am trying to create a automation rule that will create tickets on a scheduled basis.  couple of mandatory fields in the ticket form are not available in the "choose fields to set" dropdown in the automation.  Hence i am using the advanced optoin available which is asking for a json format.  I have provided the below parameters however the automation keeps failing for syntax i think.  I have tried validating my json script online tools and they say it does not have any error. 

------------

{
"fields": {
"customfield_10213": "Azure",
"Module Classification": {
"value": "Unified Archival Admin",
"child": {"value": "Reports"}
}
}
}

-------------------

I am getting the below error:

 

Error creating issue
Can not instantiate value of type [simple type, class com.atlassian.jira.issue.fields.rest.json.beans.CustomFieldOptionJsonBean] from JSON String; no single-String constructor/factory method (customfield_10213)

1 answer

1 accepted

0 votes
Answer accepted
Kseniia Trushnikova
Community Champion
August 18, 2023

Hi @Vamsi Krishna Panthulu,

What is the type of the field "customfield_10213"?

Instead of "customfield_10213": "Azure", try to use this:

{
"fields": {
"customfield_10213": { "value": "Azure" }
}
}

 

Vamsi Krishna Panthulu August 18, 2023

Thank you @Kseniia Trushnikova that worked for me.

 

I am trying to also define the request type for the new ticket in JSON.  however, it is not working as expected and throwing the below error.  I have used the field actual name as well as cf code, but still see the same issue.  the value i am providing for this field is a valid request type in this project.  any advise please.  10010 is the request type field.

 

{
"fields": {
"customfield_10213": {
"value": "Azure"
},
"customfield_10010": "System Consulting",
"Module Classification": {
"value": "Unified Archival Admin",
"child": {
"value": "Reports"
}
}
}
}

 

Error creating issue
Invalid customer request value (customfield_10010)

Kseniia Trushnikova
Community Champion
August 18, 2023

@Vamsi Krishna Panthulu, use ID instead of a request type name, for example:

"customfield_10010": "5"

Request type.png

The other way is to use the action Edit Request type mentioned in this question.

Vamsi Krishna Panthulu August 18, 2023

thank you i used the option of value as number and it worked like a charm.

Like Kseniia Trushnikova likes this

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