Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Mike
    How to change a Custom Objects field from null to something...Answered
    Topic posted March 12, 2019 by MikeBronze Medal: 1,250+ Points, tagged REST 
    74 Views, 2 Comments
    Title:
    How to change a Custom Objects field from null to something else.
    Summary:
    Create an Incident and update the Custom Object (ParentIncident) from null to something else?
    Content:

    Hi, I am trying to set the value of a customer object from "null" to something else like "123" for example. I attempted to craft a curl command to create an incident and set the value for a custom object using the following command. However it returns "title": "Bad JSON syntax found in the request"

     

    curl -u user -X POST -H "OSvC-CREST-Application-Context:Create Incident" -H "Content-Type:application/json" -d "{\"primaryContact\":{\"id\":14602},\"subject\":\"Test Incident\"},"customFields": {"CO": {"ParentIncident": 123}" https://oracle.custhelp.com/services/rest/connect/v1.3/incidents

    Version:
    18A

    Best Comment

    Vlad

    Your JSON doesn't look good. Try this:

    curl -u user -X POST -H "OSvC-CREST-Application-Context:Create Incident" -H "Content-Type:application/json" -d "{\"primaryContact\":{\"id\":14602},\"subject\":\"Test Incident\",\"customFields\": {\"CO\": {\"ParentIncident\": 123}}}" https://oracle.custhelp.com/services/rest/connect/v1.3/incidents

    Comment

     

    • Vlad

      Your JSON doesn't look good. Try this:

      curl -u user -X POST -H "OSvC-CREST-Application-Context:Create Incident" -H "Content-Type:application/json" -d "{\"primaryContact\":{\"id\":14602},\"subject\":\"Test Incident\",\"customFields\": {\"CO\": {\"ParentIncident\": 123}}}" https://oracle.custhelp.com/services/rest/connect/v1.3/incidents

    • Mike

      That worked. Thanks!