Example of using the simplified REST API to search and update a change request
To retrieve change request details based on search criteria
cURL example
'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change/search?filter=My Group Need Attention Tickets&optimize=Y
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"limit": 10,
"offset": 10,
"sortBy": [{ "field" : "priority", "order": "desc"}],
"fields": "['\''id'\'','\''status'\'']",
"criteria": {
"bindingExpression": "AND",
"conditions": "{\r\n \"fieldName\": \"status\",\r\n \"operation\": \"eq\",\r\n \"fieldValue\": \"27000\"\r\n },\r\n {\r\n \"fieldName\": \"assignee\",\r\n \"operation\": \"eq\",\r\n \"fieldValue\": \"Allen Allbrook\"\r\n }"
}
}'
Request URL
Request body
""limit"": 2,
""offset"": 0,
""criteria"": {
""bindingExpression"": ""AND"",
""conditions"": [
{
""fieldName"": ""status"",
""operation"": ""neq"",
""fieldValue"": ""10""
},
{
""fieldName"": ""status"",
""operation"": ""neq"",
""fieldValue"": ""11""
},
{
""fieldName"": ""status"",
""operation"": ""neq"",
""fieldValue"": ""12""
},
{
""fieldName"": ""status"",
""operation"": ""neq"",
""fieldValue"": ""13""
}
]
}
}"
To retrieve change request details based on the request ID
cURL example
Request URL
To update the status of a change request
cURL example
'https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change/CRQ000000000001' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"coordinator": {
"loginId": "PetramcoCMManager"
},
"coordinatorGroupId": "SGP000000000213",
"coordinatorGroup": "Petramco Support Group1",
"coordinatorGroupOrganization": "Petramco Support Org1",
"coordinatorGroupCompany": "Petramco"
} '
Request URL
Request body
"coordinator": {
"loginId": "PetramcoCMManager"
},
"coordinatorGroupId": "SGP000000000213",
"coordinatorGroup": "Petramco Support Group1",
"coordinatorGroupOrganization": "Petramco Support Org1",
"coordinatorGroupCompany": "Petramco"
}
The following example demonstrate how to perform the operations 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 search and update a change request
- Open the Postman - REST Client.
Depending on your goal, set the request URL and method as any of the following:
Goal
Method
Sample URL
To retrieve change request details based on search criteria
POST
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change/search?filter=<Filter>
To retrieve change request details based on the request ID
GET
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change/CRQ000000000001
To update the status of a change request
PATCH
https://<Innovation Suite server URL>/api/com.bmc.dsm.itsm.itsm-rest-api/v2/change/CRQ000000000001
- Click Headers.
Enter the following data as key value pairs in the header:
Key
Value
X-Requested-By
XMLHttpRequest
Content-Type
application/json
- On the Body tab, select raw.
- From the list, select JSON.
Enter the JSON.
For example- Click Send.
The results are displayed on the response panel.