Mailing List Archive

XmlRpcPlugin, changing ticket attrbutes
Hello,

I try to use the XML RPC of XmlRpcPlugin to change tickets. How do I use
the struct types for custom fields of ticket.update?
I tried:

<?xml version="1.0"?>
<methodCall>
<methodName>ticket.update</methodName>
<params>
<param><int>588</int></param>
<param>
<struct><member><name>custom_prio</name><value><string>600
</string></value></member></struct>
</param>
</params>
</methodCall>

But I got
<string>''dict' object has no attribute 'strip'' while executing
'ticket.update()'</string>

Best regards.

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/527ffed7-0097-4e33-91e5-37165772d184%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Re: XmlRpcPlugin, changing ticket attrbutes [ In reply to ]
On Tuesday, July 16, 2019 at 4:21:25 AM UTC-7, Mo wrote:
>
> Hello,
>
> I try to use the XML RPC of XmlRpcPlugin to change tickets. How do I use
> the struct types for custom fields of ticket.update?
> I tried:
>
> <?xml version="1.0"?>
> <methodCall>
> <methodName>ticket.update</methodName>
> <params>
> <param><int>588</int></param>
> <param>
> <struct><member><name>custom_prio</name><value><string>600
> </string></value></member></struct>
> </param>
> </params>
> </methodCall>
>
> But I got
> <string>''dict' object has no attribute 'strip'' while executing
> 'ticket.update()'</string>
>
> Best regards.
>


Method signature is:

array ticket.update(int id, string comment, struct attributes={}, boolean
notify=False, string author="", DateTime when=None)

So you are missing the comment argument.

Please try:
>>> d = xmlrpclib.dumps((588, 'comment', {'custom_prio': '600'}),
'ticket.update');>>> print(d)
<?xml version='1.0'?>
<methodCall>
<methodName>ticket.update</methodName>
<params>
<param>
<value><int>588</int></value>
</param>
<param>
<value><string>comment</string></value>
</param>
<param>
<value><struct>
<member>
<name>custom_prio</name>
<value><string>600</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/5a91c75f-b3b8-4968-8ffd-8676d4749245%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.