It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Update Field using Python

Ishrat Lallmamode Dec 20, 2017

Good morning, 

 

I am trying to update a custom field in Jira, using the following code and I'm getting a 415 error code. Any help would be greatly appreciated! 

 

import json
import requests

jiraSession = requests.Session()


username = input("username: ")
password = input("password: ")
jiraURL = 'http://ourbaseurl.jira.com'


#-------------- CALL -----------------

searchAPI = jiraURL + '/rest/api/2/issue/ISSUE-1'
holder = requests.put(searchAPI, auth=(username, password), data=
{"update":
{"customfield_1000":
{
"set":
{
"value": "FIELD VALUE"
}
}
}})


 

1 answer

1 vote
Edwin Kyalangalilwa Community Leader Dec 20, 2017 • edited

Hi Ishrat,

https://jira.readthedocs.io/en/master/examples.html#issues

You can do 

issue = jira.issue('ISSUE-1')

issue.update(fields={'summary': 'new summary', 'description': 'A new summary was added'})
Ishrat Lallmamode Dec 20, 2017

Thanks!   I was trying to avoid using the jira python library because it runs kind of slow. Though, my custom field is a Tempo field, so I'm assuming that's what's causing my issues. 

Edwin Kyalangalilwa Community Leader Dec 20, 2017

This is what i mostly use, haven't had any issues or tested with a Tempo field. I'll take a look.

Ishrat Lallmamode Dec 20, 2017

I still appreciate your help! I will go ahead and use the jira-python library. 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira Software

Early Access: If you use Jenkins and Jira Software Cloud, you need to read this!

The Jira Software Cloud Team has been busy working on a simple, secure, and reliable way to integrate your build and deployment information from Jenkins with Jira Software Cloud. This means you don’t...

226 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you