How are allowedValues of a custom field ordered in createmeta?

Chris Dunford May 27, 2018

I'm using the REST API to create a report for a custom field. The field is a select list, which means that there is an ordered set of allowed values. Correct ordering of the values is important to the report because they represent sequential stages in a process.

The allowed values are returned in the createmeta JSON for the field. They seem to be in the same order as they appear on the custom field configuration screen, but is this guaranteed? 

IOW, is it safe to assume that the first item in the allowedValues JSON array is the first item in the select list, etc.?

1 answer

1 accepted

1 vote
Answer accepted
Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 27, 2018

@Chris DunfordOnce you create a custom field as you  know you  order the options of the custom field as you  want. What ever you  define in the JIRA API  configuration for the custom field is what  you  get  back surely when you perform  a GET  request via REST AP
To  verify  this re- order values  customfield_1801( a, b, c, d)  to  customfield_1801(c,d ,a, b)  in your test  environment and  see  what  it returns in the  Createmeta JSON  it should be the newly ordered values in the array,  so   i think  you  should  feel  save.

Best!

Chris Dunford May 27, 2018

@Moses ThomasYes, the createmeta order does change when I reorder the items in the custom field configuration. What I'm hoping for is an Atlassian guarantee that this is reliable. :-)

Thanks for the response!

Moses Thomas
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 27, 2018

@Chris Dunfordplease accept  answer so  that  it could  be useful  to  others.

Chris Dunford May 29, 2018

@Moses ThomasMoses, I am still hoping that Atlassian drops by and responds, "Yes, the order of the items in createmeta will always be the same as the order of the items in the field configuration screen."

If that doesn't happen in a few days, I will accept your answer.

Suggest an answer

Log in or Sign up to answer