how to get customfield select list

Ugur GUNGOR August 20, 2014

how can i get customfield select list as a string list with python or java.

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 20, 2014

Do you mean the options currently selected on a custom field for a particular issue, or the whole list of possible options for the field for a given project and issuetype?

Ugur GUNGOR August 20, 2014

Yes i mean i want know for particular issue

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 20, 2014

issue.getCustomFieldValue(customfield) will return an array of the currently selected options, which you can then iterate over to get the list of options. (Sorry, I don't use python, but that's the java api call which will do the job)

Ugur GUNGOR August 20, 2014

cfm = ComponentManager.getInstance().getCustomFieldManager()

cf=cfm.getCustomFieldObjectByName("CustomFieldName")

example=issue.getCustomFieldValue(cf) // returns error.

Ugur GUNGOR August 20, 2014

https://docs.atlassian.com/jira/6.2.1/com/atlassian/jira/issue/Issue.html

this page says it returns object. are you sure it returns array ? also what is the type of array.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 20, 2014

Yes, an array of options IS an object. Your variable "example" will look like a generic object, but if you delve into it, you'll find it's an array.

Suggest an answer

Log in or Sign up to answer