I am POST'ing the following data to our server's v2 API using Python's request library.
{
"fields": {
"customfield_10300": "8lbs 3oz",
"customfield_10315": {
"value": "Mississippi",
"child": "Harrison"
},
"project": {
"key": "BOD"
},
"issuetype": {
"name": "Task"
}
}
}
I get an error:
{
"customfield_10315": "Can not instantiate value of type [simple type, class com.atlassian.jira.issue.fields.rest.json.bean.CustomFieldOptionJsonBean] from JSON String; no single-String constructor/factory method (through reference chain: com.atalassianl.jira.issue.fields.rest.json.beans.CustomFieldOptionJsonBean[\"child\"])"
}
Is my JSON incorrectly formatted?
Where could I have gone to figure this out on my own? I unsuccessfully tried searching the documentation. I also tried googling a solution, but the results all seemed to indicate those people were double-encoding their JSON strings by accident, which I don't think I am doing.
Dear @R. Simpson ,
updating custom fields can be tricky. what type of custom is customfield_10315? What's your REST endpoint?
So long
Thomas
Hi @R. Simpson -- Welcome to the Atlassian Community!
I noted that your project field name is not enclosed in quotation marks. Have you tried to add those?
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gotcha, and thanks. A few more ideas:
You may want to check out the REST API call to create issue, which uses the ID values rather than the names for such JSON access. I cannot tell what transaction you are calling to know if that is relevant:
https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/issue-createIssue
Next, to confirm you are accessing the correct smart values/field names, you could make a call to the REST API with an example issue to check. Here's an explanation of that:
https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.