Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can i get selected customfields with multiple choice in python?

Camur88
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 7, 2022

Hello folks, i hope you can help me.

I am trying to get the value of customfield option that is selected in Jira software in python. However when i select forexample  "candidates and Intern members" on the list and print in python i get the output bellow.

[<JIRA CustomFieldOption: value='Intern members, id='10005'>, <JIRA CustomFieldOption: value='Candidates (recruits)', id='10006'>]

I would like to to get only string of the values. example

"intern members" and "Candidates".

Is there anyway to get them that way?

i prisiate all help i can get!

1 answer

0 votes
Prince Nyeche
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.
April 11, 2022

It seems you're getting this object as a list of dictionary items and the representation is what you see when printed. I believe you can do something like this

values = customFieldOptions
for value in values:
print(value.get("value")) # get the name
print(value.get("id") # get the id

Suggest an answer

Log in or Sign up to answer