Example of using the simplified REST API to create a ticket


The following example demonstrates how you can use the BMC Helix ITSM simplified API to create the tickets listed below:

  • Incident
  • Problem Investigation
  • Change


To create an incident

cURL example

curl -X 'POST' \
 'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident' \
 -H 'accept: application/json' \
 -H 'Content-Type: application/json' \  
 -d '{
    "summary": "Printer is not working",
    "impact": 2000,
    "priority": 2,
    "urgency": 4000,
    "incidentType": 0,
    "assigneeGroupId": "SGP000000000010",
    "assigneeGroup": "Frontoffice Support",
    "assigneeSupportCompany": "Calbro Services",
    "assigneeSupportOrganization": "IT Support",
    "customer": {
        "loginId": "Allen"
    }
}'

Request URL

https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident

Request Body

{
    "summary": "Printer is not working",
    "impact": 2000,
    "priority": 2,
    "urgency": 4000,
    "incidentType": 0,
    "assigneeGroupId": "SGP000000000010",
    "assigneeGroup": "Frontoffice Support",
    "assigneeSupportCompany": "Calbro Services",
    "assigneeSupportOrganization": "IT Support",
    "customer": {
        "loginId": "Allen"
    }
}

To create a problem

cURL example

curl --location --request POST '<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/problem' \

--header 'X-Requested-By: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--data-raw '{
    "summary": "Sample problem is created",
    "description": "This is sample problem to test create problem api",
    "impact": 4000,
    "urgency": 4000,
    "siteId": "STE_SOLN0002846",
    "site": "Headquarters, Building 1.31",
    "siteGroup": "United States",
    "siteRegion": "Americas",
    "company": "Calbro Services"
}'

Request URL

https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/problem

Request body

{
    "summary": "Sample problem is created",
    "description": "This is sample problem to test create problem api",
    "impact": 4000,
    "urgency": 4000,
    "siteId": "STE_SOLN0002846",
    "site": "Headquarters, Building 1.31",
    "siteGroup": "United States",
    "siteRegion": "Americas",
    "company": "Calbro Services"
}

To create a change

cURL example

curl --location --request POST '<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change' \
--header 'X-Requested-By: XMLHttpRequest' \
--header 'Content-Type: application/json' \
--data-raw '{
    "summary": "Change the printer",
    "impact": 4000,
    "urgency": 1000,
    "status": 1,
    "locationCompany": "Petramco",
    "requestedFor": {
        "loginId": "PetramcoAllTicketMaster"
    },
    "coordinatorGroupId": "SGP000000000213",
    "coordinatorGroup": "Petramco Support Group1",
    "coordinatorGroupOrganization": "Petramco Support Org1",
    "coordinatorGroupCompany": "Petramco"
}'

Request URL

https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change

Request body


{
   "summary": "RFA Status From RestAPI1",
   "impact": 4000,
   "urgency": 1000,
   "status": 1,
   "locationCompany": "Petramco",
   "requestedFor": {
       "loginId": "PetramcoAllTicketMaster"
   },
   "changeManagerGroup": "Petramco Support Group1",
   "changeManagerGroupOrganization": "Petramco Support Org1",
   "changeManagerGroupCompany": "Petramco",
   "coordinator": {
       "loginId": "PetramcoCMManager"
   },
   "coordinatorGroupId": "SGP000000000213",
   "coordinatorGroup": "Petramco Support Group1",
   "coordinatorGroupOrganization": "Petramco Support Org1",
   "coordinatorGroupCompany": "Petramco"
}

The following example demonstrate how to perform the operation by using Postman client.

Before you begin

Make sure that you have a valid authentication token. For more information, see Access-and-authentication-for-the-simplified-REST-API.

To create an incident by using the simplified REST API in the Postman client

  1. Open the Postman REST Client.
  2. Set the request URL as:
    https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/incident
  3. Select the operation as POST.
  4. Click Headers.
  5. Enter the following data as key value pairs in the header:

    Key

    Value

    X-Requested-By

    XMLHttpRequest

    Content-Type

    application/json

  6. Select raw.
  7. From the list, select JSON.
  8. Enter the JSON input for creating a incident.
    For example:

    "{
        ""fields"": [
            ""summary"",
            ""impact"",
            ""priority"",
            ""urgency"",
            ""incidentType"",
            ""customer"",
            ""assignee"",
            ""assigneeGroup"",
            ""assigneeGroupId"",
            ""assigneeSupportOrganization"",
            ""assigneeSupportCompany""
        ],
        ""summary"": ""Printer is not working"",
        ""impact"": 2000,
        ""priority"": 2,
        ""urgency"": 4000,
        ""incidentType"": 0,
        ""assigneeGroupId"": ""SGP000000000010"",
        ""assigneeGroup"": ""Frontoffice Support"",
        ""assigneeSupportCompany"": ""Calbro Services"",
        ""assigneeSupportOrganization"": ""IT Support"",
        ""customer"": {
            ""loginId"": ""Allen""
        }
    }"

    You can customize the create criteria by using either AND or OR in bindingExpression.

  9. Click Send.
    The results are displayed on the response panel.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*