This is a public Forum  publicRSS

Topic

    Ian Oliver
    Creating an Incident via SOAP web servicesAnswered
    Topic posted August 9, 2018 by Ian OliverWhiz, last edited August 9, 2018 
    92 Views, 6 Comments
    Title:
    Creating an Incident via SOAP web services
    Content:

    Hi All

    We are needing to create incidents via a SOAP request via web services and are struggling to populate incident object fields and incident custom fields.  I am pretty sure some where on here I have seen examples (i have scoured the documentation but to no prevail) of this but cant seem to find it anywhere. 

    Below is what we are sending but this fails, if we take off  AssignedTo, Queue and Status it works.

    So what we are after is a full breakdown of the <RNOnjects xsi: type="v11:Incident"> and also how we populate custom fields.

    From the documentation I see what format we have to use. But when we apply that format it doesn't work.

    Does anyone have any help ?

    Cheers

    Ian

    Code Block:

    Best Answer

    Robert Surujbhan

    Ian - couple of issues here - mainly with field order (should be alphabetical - that's why it worked when you removed AssignedTo, Queue and Status!) and also with the object structure of the Status and Threads fields (Status should be wrapped under a StatusWithType and Threads needs a ThreadList parent containing EntryType and Text - refer to the API docs for more info on exactly what is needed).  Take a look at the attached example and give it a try.  You'll notice the differences!  Are you creating the raw soap/xml messages manually, or are you using an application framework to invoke the services?

    Answer

     

    • Ian Oliver

      This is the error we get

      RightNowSyncService|urn:wsdl.ws.rightnow.com/v1_3 failed
      Found out-of-order or unrecognized node StatusWithType|urn:objects.ws.rightnow.com/v1_3 while parsing node of type Incident|urn:objects.ws.rightnow.com/v1_3

      We also get the same error for AssignedTo & Queue

      Cheers

      Ian

    • Robert Surujbhan

      Ian - couple of issues here - mainly with field order (should be alphabetical - that's why it worked when you removed AssignedTo, Queue and Status!) and also with the object structure of the Status and Threads fields (Status should be wrapped under a StatusWithType and Threads needs a ThreadList parent containing EntryType and Text - refer to the API docs for more info on exactly what is needed).  Take a look at the attached example and give it a try.  You'll notice the differences!  Are you creating the raw soap/xml messages manually, or are you using an application framework to invoke the services?

    • Ian Oliver

      This is brilliant, thank you Robert, worked immediatley ;-)

      How do I deal with custom fields ?

      Thanks again!

      Ian

    • Robert Surujbhan

      Hi Ian - great! No problem.  Regarding custom fields - sure, I can generate an example of that for you.  Can you provide some details of one that you have on your Incident object?  Field name and ID, is it a custom field vs. a system attribute, the data type (yes/no, text, a menu, date/time, etc.)?  These configuration details matter for how it gets translated into the soap/xml message.

    • Ian Oliver

      Hi Robert

      Thanks!

      Ok we have a field (custom incident field ) incident.c$priority, its ID 155 and its a menu field

      and we also have an incident custom yes or no field incidents.c$acknowledged ID is 187

      Thanks again

      Ian

    • Robert Surujbhan

      Hi Ian - attached is an example of how you would set your priority menu and your acknowledged yes/no custom fields.  Note: for priority, you'll need the IDs for the values in the menu as well, and that's what you'd use when specifying the NamedIDValue element value (my example uses 32, which means one of the priority menu items would have that ID). For acknowledged, yes/no fields are treated as Booleans, so there you can use true/false as you'll see in the example.

      Does this help?