1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Set Custom Fields ? C# API Library

Discussion in 'Developing, APIs and extending' started by Robert Merwin, Apr 19, 2012.

  1. Robert Merwin

    Robert Merwin Member

    I can retrieve TicketCustomFields with GetTicketCustomFields and see the FieldContent of each custom field. The retrieval part works fine.

    But the FieldContent values I supply to UpdateTicketCustomFields do not get saved.

    UpdateTicketCustomFields returns the same structured data as GetTicketCustomFields and has the values I set by editing the ticket manually through the browser interface - not the values I supplied in UpdateTicketCustomFields.

    I am using version 1.2.0 of the C# API.
    We have two ticket custom groups defined, one for "Staff & User Ticket Creation", and the other with "User" group type. There are two fields in the "Staff & User Ticket Creation" group, and these are what I am retrieving in my test application. Once set with values, these fields are visible in the browser interface.

    It seems like updating custom field content should work. Since I get no errors/exceptions it looks like I am supplying the right information to the UpdateTicketCustomFields method.

    It is critical to my company that we be able to update custom fields through the API.
    Any suggestion would be very much appreciated!

    Thanks.
     
  2. Tomasz Sawicki

    Tomasz Sawicki Established Member

    I'm getting the same strange behaviour while developing updated PHP REST Client but only some type of fields are affected by this (Checkbox, Radio, Multiselect, Linked select and Select). I can save custom fields, and I receive what I saved using REST (not only as the response to save request but also in consecutive fetch requests) but when viewing them through Staff CP these fields are not set. I've reported bug issue for this.
     
  3. Robert Merwin

    Robert Merwin Member

    Thanks, Tomasz.

    I see you had mixed success updating ticket custom field values.

    With the C# API I can't get any values - not even plain text - to update.
     
  4. CRMUser

    CRMUser New Member

    What version of Fusion is required to run the version 1.2.0 of C# API ? I am running 4.01.326 and the GetCustomFields throws an exception.
     
  5. Robert Merwin

    Robert Merwin Member

    We're on Resolve version 4.40.986.

    I have no trouble with GetCustomFields. I loop through them with:
    Code:
    foreach (CustomField cField in kClient.CustomFields.GetCustomFields())
    I've had no success with UpdateTicketCustomFields actually updating custom field values.
    But I'm hopeful after reading that Tomasz has it figured out, if only in PHP.
     
  6. Robert Merwin

    Robert Merwin Member

    I am now convinced that the C# API UpdateTicketCustomFields method DOES NOT WORK.

    I noted BlackHawkRob's comments (http://forums.kayako.com/threads/up...oup-is-not-open-by-default.29422/#post-140221) that there seems to be a caching issue when ticket custom fields are set. The behavior I see in my testing is that when I create a ticket through the API and call GetTicketCustomFields, the FieldContent values are all null. I have only a Linked Select fields and two Text fields: all 3 have default values defined. However, if after creating the ticket, I update the ticket through the browser interface, then GetTicketCustomFields returns the default values for each of the fields. Looks like a caching issue BlackHawkRob talked about.

    But whether or not my app can retrieve the default values, it is unable to update any of them. After I call UpdateTicketCustomFields the field content values are never changed, whether they start from null or the default values.

    Tomasz seems close to getting the PHP API fixed. I saw his comment in the REST API Reference that at least the Radio, Select, Checkbox, and Multi Select fields need for the field option id and not the option value to be specified. But the C# API uses the value.

    I hope this will this be fixed soon.
     
  7. Robert Merwin

    Robert Merwin Member

    Update: More accurately, through the C# API I can create Ticket Custom Field records.

    What does not work is setting the Field Content for those fields.

    The TicketCustomFields returned by UpdateTicketCustomFields shows null as the value for each one of my custom fields.

    Any help in resolving this issue would be very much appreciated!
     
  8. Lokesh Deshmukh

    Lokesh Deshmukh New Member

    Yes. The same issue with Kayako resolve version using C# API. Please help.
     
  9. stevenwells99

    stevenwells99 Member

    Hi , Did anyone actually find a way to do this?
     
  10. Eric Holland C# Dev

    Eric Holland C# Dev New Member

    Not sure if anyone has figured this out yet, but it appears the API now works with one caveat. Many custom fields in Kayako are integer based as is the case for selection elements. I was attempting to set the custom field to a string, when the API was expecting an integer.
     

Share This Page