Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,273
Community Members
 
Community Events
176
Community Groups

Updating radio button field on JIRA using Python

I am trying to update radio button fields in JIRA using python logic by building a dictionary. After I built the dictionary, when I try to create issue in JIRA, I am getting an error message -

 

'customfield_10543': "Option id 'null' is not valid"}

 Python logic:

 

options = ['10461','10462']
new_issues = []
new_issue = {
                    'project': {"key":"Test"},
                    'summary': 'Test Summary',
                    'description': 'Test issue by Jira Integration'
)

if df.having_pet.iloc[i] == 'YES':
   new_issue[having_pet] = {'value':options[0]}
if df.having_pet.iloc[i] == 'NO':
   new_issue[having_pet] = {'value':options[1]}
new_issues.append(new_issue)
jira.create_issues(field_list=new_issues)

 

HTML component from Chrome Inspector:

 

<input class="radio" id="customfield_10543-1" name="customfield_10543" type="radio" value="10461" resolved="">
<label for="customfield_10543-1">
Yes
</label>
<input checked="checked" class="radio" id="customfield_10543-2" name="customfield_10543" type="radio" value="10462" resolved="">
<label for="customfield_10543-2">
No
</label>

 Please advise how to update the radio button on JIRA based on dataframe that i have.

1 answer

0 votes

I know nothing of python or what seems to be a python jira client.

But I know that when updating a radion button with a REST API, the JSON for the value of the option you want to select will look like either

{"customfield_10543":{"value":"Yes"}}

or

{"customfield_10543":{"id":"10461"}}

So I would try changing this:

new_issue[having_pet] = {'value':options[0]}

to

new_issue[having_pet] = {'value':'Yes'}

or

new_issue[having_pet] = {'id':options[0]}

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events