What is the JIRA REST call to create CUSTOM FIELDS?

Jeff Porter February 28, 2018

 

How do I create via REST a CUSTOM FIELD with options and child options?

e.g the following format...

CUSTOM FIELD "ItemOptions"

1. 001 Payments

    001-01 Card

    001-02 Cash

2. 002 Returns

    002-01 Damaged

    002-02 Ignored

 

 

 

3 answers

0 votes
Jeff Porter February 28, 2018

I think I can do it via POST /rest/api/2/field/{fieldKey}/option

 

If only I could work out what {fieldKey} is meant to be!?!?! 

 

The fields can be referenced in the REST API by a field key with the format: $(app-key)__$(field-key).

 

So field-key is made up of field-key ?!?

Danyal Iqbal
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.
February 28, 2018

For clarification, this endpoint is only compatible with fields that are created with the Atlassian Connect Add-on.

No harm in trying though. {fieldKey}= 12400 for customfield_12400 and so on.

Post the following json:

{"value": "parent", "child": {"value":"child"} }

  watching thread for any cool workaround since there is currently no way to add options through REST endpoints.

Jeff Porter February 28, 2018

The link above seems to say you can (on the cloud)...

Create issue field option

  1. https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-field-post
Danyal Iqbal
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.
February 28, 2018

This is misleading.

0 votes
Danyal Iqbal
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.
February 28, 2018

not possible with Rest endpoints. Try the Bulk Import Custom Field Values feature in script runner

0 votes
Steven Behnke
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.
February 28, 2018

The title is asking how to list custom fields via rest, the description is asking how to create a cascading select field via rest. Which is it? Both?

Both are answered by documentation - 

  1. https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-field-get
  2. https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-field-post
Jeff Porter February 28, 2018

Thanks, I started with one question that I answered myself and then ended updating the body of the question. I've updated the title as well now. 

Like ykatayama1 likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events