REST API cannot get customfiled options

haoyu900914 March 14, 2022

Have a customfield with any type, which is used for sprint or epic. 

1.I tried to get the info using createissue api. but those custom fields returned without allowedValues. 

 

2. I also tried to get the options through the field context. But it returns 400 for the response. 

     a. I first tried to get the context id through                `rest/api/3/field/customfield_10014/contexts`,

it returns `

{

  maxResults: 50,

  startAt: 0,

  total: 1,

  isLast: true,

  values: [

    {

      id: '10114',

      name: 'Default Configuration Scheme for Epic Link',

      description: 'Default configuration scheme generated by Jira',

      isGlobalContext: true,

      isAnyIssueType: true

    }

  ]

}

`

I suppost `10114` is the context id I used that for the context api call the context option api call. it returns `400` error.

I also tried the jql api, but turns out to be it always return a issue, instead of the field options. 

 

How can I get the list of options for the customfield? 

 

1 answer

0 votes
haoyu900914 March 17, 2022

For epic and sprint, Jira has agile server API to get the options. 

https://docs.atlassian.com/jira-software/REST/7.3.1/?_ga=2.209676690.1244573884.1647156425-1322153895.1616102704#agile/1.0/board/{boardId}/epic-getEpics

 

Have no idea why those 2 fields are included in the custom field. 

Suggest an answer

Log in or Sign up to answer