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

Update custom field using jira-python

issue.update(fields={'customfield_10100': {'value','Two'}})

I have a multiselect list and below error occurs if i try to update

"response text = {"errorMessages":[],"errors":{"Custom_field":"data was not an array"}}"

2 answers

1 accepted

3 votes
Answer accepted
Shaun S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jul 29, 2017

Hi Amar,

 

I was able to set the field values for a multi-select field by correcting the syntax of the code you provided.  I used the REST API Example as a guide.  If you change the code to read as 

issue.update(fields={'customfield_10100': [{'value':'Two'}]})

I believe it should work. 

yes thank you for the reply.. i did figured it out

Hey i need to modify single select field (drop down)  i tried below code.

1. issue.update(fields={'customfield_11104': 'Staging'})

2. issue.update(fields={'customfield_11104': [{'value': 'Staging'}]})

3. I tried this one also issue.update(fields={'customfield_11104':[{'value':'46707'}]})

but got the error like 

response text = {"errorMessages":[],"errors":{"customfield_11104":"Could not find valid 'id' or 'value' in the Parent Option object."}}

Like Carlos Catrilef likes this

This customfield_11104 is a single select dorp down field.

The metadata for my single select dropdown field includes "set", "value" and "id" and I found that only  "id" worked as follows:

 issue.update(fields={'customfield_11104': {'id':'10034'}})

I found the "id" for my field as follows:

jira = JIRA(jira_server, basic_auth=(jira_user, jira_token))
meta = jira.editmeta('ABC-1')
print(meta)

Suggest an answer

Log in or Sign up to answer