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

Unable to edit an Issue through Jira Rest API

I am trying to edit a JIRA Issue using REST API . I get a 405 error when I run the following code.

I already read . But I don't understand why I am getting a 405.

I also checked https://** , which gives the list of fields I can edit.

newValues = dumps(
"update": {
"summary": [
"set": "blah "
newValues = dumps({
"summary":"CLONE - Testing label stuff",
headers = {"Authorization": " Basic " + b64encode(username + ":" + password), "Content-Type": "application/json"}
request = requests.put("https://****"+IssueID+"/editmeta", data=newValues, headers=headers)
print request
except urllib2.HTTPError, error:


Can someone help me with the issue or provide a working python code to edit issue by key/ID??


3 answers

1 vote

Hello Jag,

Thank you for your question.

Please, run the following:

import requests, json, base64

username = 'YOUR_USERNAME'
password = 'YOUR_PASSWORD'

pageData = {
        "summary":"NEW SUMMARY",
headers = {
    "Authorization": " Basic " + base64.b64encode(username + ":" + password), 
    "Content-Type": "application/json"
print json.dumps(pageData)    
r = requests.put(
print r

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

fields might got added to screens more than once.

To identify duplicate entries use this query

select, i.fieldidentifier, count(*)
from fieldscreen f, fieldscreenlayoutitem i, fieldscreentab t
where = t.fieldscreen
and i.fieldscreentab =
group by, i.fieldidentifier having count(*) > 1;


Based on the results, remove those fields from respective screens.


Thank You


Hi Jag,

The error 405 "Method not allowed" happens because urllib2 does POST instead of PUT. I also had this one.

The next code works for me:

    opener = urllib2.build_opener(urllib2.HTTPHandler)
    queryURL = serverURL + '/rest/api/latest/issue/' + taskID

    newValue = {
        "fields": {
            "customfield_10500": new_value

    req = urllib2.Request(queryURL)
    req.add_header("Content-type", "application/json")
    req.add_header("Accept", "application/json")
    req.get_method = lambda: 'PUT' # this line is the key!
    fp =

Best regards,


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in United States

Live! - Austin ACE -- Summer BASH 2019

Hey Austin! Come join us for our 2019 Atlassian Community Summer BASH as we transition ourselves into party status! Bring an attachment, log a great time, and collaborate with new friends as we celeb...

13 views 0 0
View post

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