The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Update Field using Python

Ishrat Lallmamode
December 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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Edwin Kyalangalilwa
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 Champions.
December 20, 2017

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
December 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
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 Champions.
December 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
December 20, 2017

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

TAGS
AUG Leaders

Atlassian Community Events