Jump to content

API LogIncident Custom Fields


Recommended Posts

We have an integration with Service Now where a 3rd party will create incidents for us based upon alerts they get on their system. They currently use the API (LogIncident) to create these tickets. We are trying to allow them to update a custom field with the Service Now System ID to allow two way integration however while we are not receiving an error, the custom field is not being populated. Below is the payload information we are sending. Is there something drastically being done wrong?

{

    "@service": "apps/com.hornbill.servicemanager/Incidents",

    "@method": "logIncident",

    "params": {

      "summary":"Test Ticket",

      "description":"Pls Ignore",

      "requestType":"Incident",

      "customerId":"J Smith",

      "customerType":"0",

      "teamId":"IT_Team",

      "status":"status.open",

      "serviceId":"31",

      "siteId":"59",

      "siteName":"Site A",

      "externalRefNumber":"CS0030050",

      "questionFieldMap": "[{\"h_custom_31\": \"c3062b18fbfdc2dcf1cbfb5ebeefdc7c\"}]"

}

Link to comment
Share on other sites

Hi @danec,

This is a nice easy one :) The question field map should be a stringified JSON object, not a stringified array, as per the docs:

https://docs.hornbill.com/servicemanager-api-api/entities/servicerequests/espflowcodeentityoperation/content/logServiceRequest#questionfieldmap

 So your example should look like the below, note the removal of the square brackets from your questionFieldMap string:

{
    "@service": "apps/com.hornbill.servicemanager/Incidents",
    "@method": "logIncident",
    "params": {
      "summary":"Test Ticket",
      "description":"Pls Ignore",
      "customerId":"J Smith",
      "customerType":"0",
      "teamId":"IT_Team",
      "status":"status.open",
      "serviceId":"31",
      "siteId":"59",
      "siteName":"Site A",
      "externalRefNumber":"CS0030050",
      "questionFieldMap": "{\"h_custom_31\": \"c3062b18fbfdc2dcf1cbfb5ebeefdc7c\"}"
}

Hope this helps,

Steve 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...