How to get all the Options of one CustomField (Select List) using python?

zeng qing December 14, 2020

My goal is really simple. To retrieve all the options of a given Custom Field using python, that's all.

Thanks in advance.

1 answer

1 accepted

0 votes
Answer accepted
Warren
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.
December 14, 2020

Hi @zeng qing 

I use the following API call 

/rest/api/2/issue/createmeta?projectKeys=ABC&expand=projects.issuetypes.fields&issuetypeNames=Task

which returns all metadata for the project, you just have to loop through to find the customfield you're interested in

Within the JSON, you will get something like this

Screenshot_8.jpg

zeng qing December 14, 2020

it works,thank you. if use python:

metas=jira.createmeta(projectKeys='IRVR',issuetypeIds='11105',expand='projects.issuetypes.fields')
d=metas['projects'][0]['issuetypes'][0]['fields']['customfield_11735']['allowedValues']

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events