Opened 9 years ago
Closed 9 years ago
#12457 closed defect (worksforme)
Ticket Update Function Syntax Error
Reported by: | anonymous | Owned by: | osimons |
---|---|---|---|
Priority: | normal | Component: | XmlRpcPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description
Here is my function call:
# Update the information for existing ticket tid, created, modified, attrs = p.ticket.get(int(TRACID[x])) about = p.ticket.update( int(TRACID[x]), {"reporter": reporter, "keywords": category[x], "version": version[x], "component": component, "owner": owner, "type": type[x], "resolve": resolution[0], "milestone": "D2D_Sync_Issues", "requestor": disp_prio, "status": status, "collective": combine_priority[x], "d2d_id": D2DID[x], "action": 'leave', "_ts": attrs['_ts']}, notify=False, when=None )
I am getting the following error:
TypeError: __call__() got an unexpected keyword argument 'when'
Upon removal of 'when=None', I get this error:
TypeError: __call__() got an unexpected keyword argument 'notify'
Upon removal of 'notify=False', I get this error:
Traceback (most recent call last): File "P:\D2D Sync\MergedScripts\On Trac not D2D new xml node.py", line 221, in <module> "d2d_id": D2DID[x]} File "C:\Python27\lib\xmlrpclib.py", line 1240, in __call__ return self.__send(self.__name, args) File "C:\Python27\lib\xmlrpclib.py", line 1599, in __request verbose=self.__verbose File "C:\Python27\lib\xmlrpclib.py", line 1280, in request return self.single_request(host, handler, request_body, verbose) File "C:\Python27\lib\xmlrpclib.py", line 1313, in single_request return self.parse_response(response) File "C:\Python27\lib\xmlrpclib.py", line 1490, in parse_response return u.close() File "C:\Python27\lib\xmlrpclib.py", line 799, in close raise Fault(**self._stack[0]) Fault: <Fault 1: "''dict' object has no attribute 'strip'' while executing 'ticket.update()'">
What is wrong with my syntax?
Attachments (0)
Change History (7)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Yes, I am using RPC version (1.1.4). I can get this script to work:
tid, created, modified, attrs = p.ticket.get(96) about = p.ticket.update( tid, 'comment1', {"version": "4.0.1", "action": 'leave', "_ts": attrs['_ts'] })
However, the script with additional attributes does not work.
Is there anything in D2DID[x] that could be causing my initial problem I am not sure what this error means. The value in the variable D2DID[x] is '430'. Should I be including the values for "when" and "notify" in the function call or not? It's listed in the documentation, but the functional script doesn't contain those parameters.
comment:7 Changed 9 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Replying to anonymous:
You also need the 'comment' parameter.
Yes, I'm quite sure this is the real problem. Your initial call from ticket description omitted this required positional argument.
See #12430. Related? Duplicate? Using latest RPC version (1.1.4)?