Closed
Bug 1315694
Opened 8 years ago
Closed 8 years ago
REST API for Update bug not working : http://bugzilla.readthedocs.io/en/latest/api/core/v1/bug.html#update-bug
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: kumudini.shirsale, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID: 20160919122641
Steps to reproduce:
Call for my python function :
resolve_params = {"status": "CLOSED", "resolution": "NOTABUG"}
t.transition_ticket(resolve_params)
Definition for the class:
def transition_ticket(self, resolve_params):
"""
Resolving a Bugzilla ticket.
:param resolution: A string representing the resolution to be added.
:return:
"""
if not self.ticket_id: # Create the payload for our update.
logging.error("No ticket ID associated with ticket object. Set ticket ID with set_ticket_id(ticket_id)")
return
try:
params = resolve_params
if self.token:
params['token'] = self.token
r = self.s.put("{0}/{1}".format(self.rest_url, self.ticket_id), json=params)
r.raise_for_status()
print(r.text)
logging.debug("Resolving Ticket: Status Code: {0}".format(r.status_code))
logging.info("Updated ticket {0} - {1}".format(self.ticket_id, self.ticket_url))
# Instead of using e.message, use e.args[0] instead to prevent DeprecationWarning for exception.message.
except requests.RequestException as e:
logging.error("Error resolving the ticket")
logging.error(e.args[0])
Actual results:
Erroring out:
NFO:root:Successfully authenticated to Bugzilla with token: XXX
{"documentation":"https://example.com/docs/en/html/api/index.html","error":true,"code":50,"message":"The function Agile.Team.update requires a id argument, and that argument was not set."}
DEBUG:requests.packages.urllib3.connectionpool:"PUT /rest/bug/xxxx HTTP/1.1" 200 181
DEBUG:root:Resolving Ticket: Status Code: 200
INFO:root:Updated ticket xxxx
Expected results:
It should update the bugzilla id with the specified params.
Reporter | ||
Updated•8 years ago
|
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Reporter | ||
Comment 1•8 years ago
|
||
Would like to add 'reslove_params' dictonary was also added for the ids parameter.
resolve_params = {"ids:""<ticket-number>", "status": "CLOSED", "resolution": "NOTABUG"}
It still failed.
Reporter | ||
Comment 2•8 years ago
|
||
Hello,
The issue was with the internal bugzilla API not being updated with the bugzilla extension.
Which works fine now
:)
this can be closed !!
Updated•8 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•