Hi Folks,
I am trying to update selectlist custom field dynamically by using REST API and getting input data from REST API and passing that data by using variable but while running the curl getting below error and we are using v2 REST API method.
command : curl -D- -u "Test@abc.com":"jiraadmin123" -X POST --data {"fields": {"customfield_16600": {"value":"$name"}, {"id":"null"}}} -H "Content-Type: application/json" https://abc.test.com/rest/api/2/issue/
Error : {"errorMessages":["Unexpected character ('f' (code 102)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@1c271e0a; line: 1, column: 3]"]}
Could you please check and let me know if any solution for this task.
If you're using this snippet from the command line, isn't your data argument value suppose to be wrapped in single quotes?
--data '{"fields":
}'
Thank you, tried without quotes but getting below error and not able to process the data without quotes.
--data {"fields": {"project":{"id": "18500"}, "customfield_16600": {"id":"19302", "value": "$name1"}}}
Error :-
{"errorMessages":["Unexpected character ('f' (code 102)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@57991445; line: 1, column: 3]"]}
Please let me know if i missed any required parameter for data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
--data '{"fields": {"project":{"id": "18500"}, "customfield_16600": {"id":"19302", "value": "$name1"}}}'
Do you see the single quote before the curly bracket, you're suppose to have that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Generaly i have an error when i'm using the value of the option.
You can use the option Id (for select list, radio button field).
You can check it in jira database or directly by editing the option on the url, you will have it in the selectedValue parameter.
Usually it starts with 10000.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, yes am trying with option id but not able to update field values able to create issues and update summary,
Here observed it's allowing to update existing values only if i tried with new entry getting unexpected value and not able to find out the option id.
--data {"fields": {"project":{"id": "18500"}, "customfield_16600": {"id":"19302", "value": "$name1"}}}
FYI..trying to publish dynamically with $name1.
Could you please check and let me know if any solution for this task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.