I'm having a huge amount of frustration trying to get the SetTicketCustomFields API call to work. Every time it returns "Failed to set the custom fields for ticket number '_______' " with an error number "-2".
I have setup a custom field named "IP_Address" and assigned it to a custom template that is assigned to the receiving department. I know it's setup correctly, because it shows up in the system interface for new tickets that are created. (But it shows up as a blank value because I am unable to set it.)
I create the ticket (successfully) from the API, and grab the new ticket number in the return response. Then I make another call to set the custom field value.
The SOAP request for call is:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<SetTicketCustomFields xmlns="http://www.smartertools.com/SmarterTrack/Services2/svcTickets.asmx">
<authUserName>__(username)__</authUserName>
<authPassword>__(password)__</authPassword>
<ticketNumber>__(ticket#)__</ticketNumber>
<customFieldValues>
<IP_Address>1.2.3.4</IP_Address>
</customFieldValues>
</SetTicketCustomFields>
</soap12:Body>
</soap12:Envelope>I have also (unsuccessfully) tried the customFieldValues as:
<customFieldValues>
<string>IP_Address=1.2.3.4</string>
</customFieldValues>
(I tried this because the full specification literally says to do it.)
If someone could please insert a quick SOAP 1.2 example of a working SetTicketCustomFields request I would be grateful.