diff options
-rw-r--r-- | bugzilla.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/bugzilla.py b/bugzilla.py index f7dc958..565d4c0 100644 --- a/bugzilla.py +++ b/bugzilla.py @@ -355,17 +355,28 @@ class Bugzilla(object): # new_fixed_id, comment, isprivate are optional raise NotImplementedError - def _setassignee(self,id,assigned_to='',reporter='',qa_contact='',comment=''): - #changeAssignment($id, $data, $username, $password) - #data: 'assigned_to','reporter','qa_contact','comment' - #returns: [$id, $mailresults] + def _setassignee(self,id,**data): + '''Raw xmlrpc call to set one of the assignee fields on a bug. + changeAssignment($id, $data, $username, $password) + data: 'assigned_to','reporter','qa_contact','comment' + returns: [$id, $mailresults]''' + return self._proxy.bugzilla.changeAssignment(id,data,self.user,self.password) + + def setassignee(self,id,assigned_to='',reporter='',qa_contact='',comment=''): + '''Set any of the assigned_to, reporter, or qa_contact fields to a new + bugzilla account, with an optional comment, e.g. + setassignee(id,reporter='sadguy@brokencomputer.org', + assigned_to='wwoods@redhat.com') + setassignee(id,qa_contact='wwoods@redhat.com',comment='wwoods QA ftw') + You must set at least one of the three assignee fields, or this method + will throw a ValueError. + Returns [bug_id, mailresults].''' if not assigned_to or reporter or qa_contact: # XXX is ValueError the right thing to throw here? raise ValueError, "You must set one of assigned_to, reporter, or qa_contact" # empty fields are ignored, so it's OK to send 'em - data = {'assigned_to': assigned_to, 'reporter': reporter, - 'qa_contact': qa_contact, 'comment': comment} - return self._proxy.bugzilla.changeAssignment(id,data,self.user,self.password) + return self._setassignee(id,assigned_to=assigned_to,reporter=reporter, + qa_contact=qa_contact,comment=comment) def _updatedeps(self,id,deplist): #updateDepends($bug_id,$data,$username,$password,$nodependencyemail) |