Update our own custom field type with REST

RambanamP
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.
April 3, 2017

Hi,

we have our own custom field type fields(select and multiselect) and we are unable to update those fields with jira REST api's .

appriciate any hel on this!

 

Thanks,

2 answers

0 votes
Ron Gates April 4, 2017

Hi Rambanam,

You didn't specify what method exactly you are using or what error you get.

But still, here is generic example on how to interact with Jira REST API using curl from commandline (like Linux Bash):

curl -D- -u 'jira-user':'jira-password' -X POST --data '{ "customfield_10000": { "id": "12000" }, "customfield_12000": [ { "id": "13000" }, { "id": "14000" } ] }' -H 'Content-Type: application/json' https://yourjirainstance.com/rest/api/2/issue/


Note that "customfield_10000" is regular dropdown field (where you can choose one option only) and "customfield_12000" is a multi select field (where you can choose one or more options).

Of course you have to replace all the IDs with appropriate ID from your Jira instance.

Also if your JSON string is very long there is a chance your script won't work - there is a workaround for that - just save JSON to file and use:

curl -D- -u 'jira-user':'jira-password' -X POST --data @'/path/to/file.json' -H 'Content-Type: application/json' https://yourjirainstance.com/rest/api/2/issue/


If you need more help I am happy to provide and also share Python example.

Best of luck and let us know if you have solved your problem (and how)!

0 votes
Sam Hall
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.
April 3, 2017

Hi Rambanam - Since this is a development related question, you might want to try asking over at the developer community site here: https://community.developer.atlassian.com

 

RambanamP
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.
April 4, 2017

Thanks ! i will post there!

Sam Hall
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.
April 4, 2017
RambanamP
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.
April 5, 2017

yes, thanks!

Suggest an answer

Log in or Sign up to answer