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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted 9 hours ago in Jira

Upcoming Enterprise releases targeting Q3 2019: Jira Software 8.5 & Jira Service Desk 4.5

Since launching the Jira Software 8.0 and Jira Service Desk 4.0 platform releases in February, many of you have been asking when the next Enterprise release will be so you can take advantage of the m...

182 views 0 3
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you