Documentation forSolarWinds Service Desk

Change Request

Create a new change request [xml]:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_XML' -H 'Accept: application/xml' -H 'Content-Type:text/xml' -X POST

https://api.samanage.com/change_catalogs/CHANGE_CATALOG_ID/change_requests.xml

XML Example:

<change_request>

<name>Some name</name>

<description>Some description</description>

<change_plan>A change plan</change_plan>

<test_plan>A test plan</test_plan>

<rollback_plan>A rollback plan</rollback_plan>

<priority>Low</priority>

<change_type>None</change_type>

<assignee><email>user@example.com</email></assignee>

<site><name>site name</name></site>

<department><name>department name</name></department>

<request_variables_attributes type="array">

<request_variables_attributes>

<name>VARIABLE_NAME</name>

<value>Variable value</value>

</request_variables_attributes>

</request_variables_attributes>

</change_request>

To create a change with a variable of type user, use the tag <user_value> instead of <value>.

XML Example:

<request_variables_attributes type=”array”>

<request_variables_attribute>

<name>VARIABLE_NAME</name>

<user_value>

<email>abc@example.com</email>

</user_value>

</request_variables_attribute>

</request_variables_attributes>

Create a new change request [JSON]:

curl -H "X-Samanage-Authorization: Bearer TOKEN" -d 'INPUT_JSON' -H 'Accept: application/vnd.samanage.v2.1+json' -H 'Content-Type: application/json' -X POST

https://api.samanage.com/change_catalogs/CHANGE_CATALOG_ID/change_requests.json

JSON Example:

{

"change_request": {

"name": "Some name",

"description": "Some description",

"change_plan": "A change plan",

"test_plan": "A test plan",

"rollback_plan": "A rollback plan",

"priority": "Low",

"change_type": "None",

"assignee": { "email": "user@example.com" },

"site": { "name":"site name" },

"department": { "name":"department name" },

"request_variables_attributes": [

{

"name": "VARIABLE_NAME",

"value": "Variable value"

}

]}

}

Specific variable type examples

USER

To create a change request with a variable of type user, use the tag “user_value" instead of “value".

JSON Example:

"request_variables_attributes": [

{

"name": "VARIABLE_NAME",

"user_value": { "email": "abc@example.com" }

}

]

DEPENDENT DROPDOWN

When using a Dependent Dropdown you will only need to enter the variable that is selected out of this dependent dropdown. The Dependent Dropdown itself should not be in the body.

MULTI-PICKLIST

To create a change request with a variable of type multi-picklist, use “#dlmtr#” to separate between values.

JSON Example:

"request_variables_attributes": [

{

"name": "VARIABLE_NAME",

"value": "option1#dlmtr#option2"

}

]