# Cherwell Service Management

> Create, find, update and delete Cherwell records such as incidents, changes and customers, run saved searches, work with related records, lifecycle transitions and One-Step Actions, and look up teams and users.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/cherwell

## Actions

### Create record

Create a record, such as an incident or a customer, from field values by field name.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Field values (`values`, object, required): Field values by field name, such as {"ShortDescription": "Printer jam"}. Get Business Object schema lists the names.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "fieldValidationErrors": [
      {
        "error": "example",
        "errorCode": "example",
        "fieldId": "example"
      }
    ]
  }
}
```

### Create related record

Create a record related to another, such as a journal note or a task on an incident.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.
- Relationship ID (`relationship_id`, text, required): The relationship's ID, from Get Business Object schema with relationships.
- Related business object (`related_bus_ob_id`, text, required): The related record's business object.
- Field values (`values`, object, required): Field values by field name, such as {"ShortDescription": "Printer jam"}. Get Business Object schema lists the names.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "fieldValidationErrors": [
      {
        "error": "example",
        "errorCode": "example",
        "fieldId": "example"
      }
    ]
  }
}
```

### Delete record

Delete a record by its public ID or record ID.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Public ID (`public_id`, text): The record's public ID, the number people see, such as an incident's number.
- Record ID (`rec_id`, text): The record's record ID (busObRecId), from an earlier step.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "done": true
  }
}
```

### Get business object schema

Get a business object's fields (names, types, required) and, if asked, its relationships.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Include relationships (`include_relationships`, true/false): Also list its relationships to other business objects.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "fieldDefinitions": [
      {
        "calculated": true,
        "description": "example",
        "displayName": "example",
        "fieldId": "example",
        "maximumSize": "example",
        "name": "example",
        "readOnly": true,
        "required": true,
        "type": "example"
      }
    ],
    "name": "example",
    "relationships": [
      {
        "cardinality": "example",
        "description": "example",
        "displayName": "example",
        "relationshipId": "example",
        "target": "example"
      }
    ],
    "stateFieldId": "example",
    "states": "example"
  }
}
```

### Get lifecycle transitions

List the lifecycle transitions (status changes) a record can make now.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "transitions": [
      {
        "id": "example",
        "isAvailable": true,
        "name": "example"
      }
    ]
  }
}
```

### Get record

Get a record, such as an incident, by its public ID or record ID, with every field's value.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Public ID (`public_id`, text): The record's public ID, the number people see, such as an incident's number.
- Record ID (`rec_id`, text): The record's record ID (busObRecId), from an earlier step.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "fields": [
      {
        "dirty": true,
        "displayName": "example",
        "fieldId": "example",
        "name": "example",
        "value": "example"
      }
    ],
    "values": {}
  }
}
```

### Get related records

Get the records related to a record through one relationship, such as an incident's journals or tasks.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.
- Relationship ID (`relationship_id`, text, required): The relationship's ID, from Get Business Object schema with relationships.
- Page (`page_number`, number): Which page of results, from 1. At least 1.
- Page size (`page_size`, number): How many to return, 1 to 200. From 1 to 200.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "pageNumber": 1,
    "pageSize": 1,
    "parentBusObId": "example",
    "parentBusObRecId": "example",
    "relatedBusinessObjects": [
      {
        "busObId": "example",
        "busObPublicId": "example",
        "busObRecId": "example",
        "fields": [
          {
            "dirty": true,
            "displayName": "example",
            "fieldId": "example",
            "name": "example",
            "value": "example"
          }
        ],
        "values": {}
      }
    ],
    "relationshipId": "example",
    "totalRecords": 1
  }
}
```

### Get service info

Get the Cherwell server's CSM and REST API versions, culture and time.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "apiVersion": "example",
    "csmCulture": "example",
    "csmVersion": "example",
    "systemDateTime": "example",
    "systemUtcOffset": "example"
  }
}
```

### Get user

Get a CSM user by their login ID, with their record ID and fields.

**Inputs**

- Login ID (`login_id`, text, required): The user's login ID.
- Login type (`login_id_type`, text): Whether it is a CSM login or a Windows login. Defaults to CSM login. One of: `Internal` (CSM login), `Windows` (Windows login).

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "accountLocked": true,
    "createDateTime": "example",
    "displayName": "example",
    "fields": [
      {
        "dirty": true,
        "displayName": "example",
        "fieldId": "example",
        "name": "example",
        "value": "example"
      }
    ],
    "publicId": "example",
    "recordId": "example",
    "securityGroupId": "example",
    "shortDisplayName": "example",
    "values": {}
  }
}
```

### Link related record

Link an existing record to another through a relationship.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.
- Relationship ID (`relationship_id`, text, required): The relationship's ID, from Get Business Object schema with relationships.
- Related business object (`related_bus_ob_id`, text, required): The related record's business object.
- Related record ID (`related_rec_id`, text, required): The related record's record ID.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "done": true
  }
}
```

### List business objects

List the business objects, such as Incident, Change Request and Customer, with each one's ID.

**Inputs**

- Kind (`object_type`, text, required): Which kind of business objects to list. One of: `Major` (Major (incidents, changes, customers…)), `Supporting`, `Lookup` (Lookup tables), `Groups`, `All`.
- Name contains (`name`, text): Only business objects whose name contains this, such as Incident.

**Outputs**

- `data` (list): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": [
    {
      "busObId": "example",
      "displayName": "example",
      "group": true,
      "lookup": true,
      "major": true,
      "name": "example",
      "stateFieldId": "example",
      "states": "example",
      "supporting": true
    }
  ]
}
```

### List One-Step Actions

List the One-Step Actions for a business object, in their folders.

**Inputs**

- Business object (`association`, text, required): The business object the searches or actions belong to, by ID.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "root": {
      "association": "example",
      "childFolders": [
        {}
      ],
      "childItems": [
        {}
      ],
      "id": "example",
      "name": "example",
      "scope": "example",
      "scopeOwner": "example"
    }
  }
}
```

### List saved searches

List the saved searches for a business object, in their folders.

**Inputs**

- Business object (`association`, text, required): The business object the searches or actions belong to, by ID.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "root": {
      "association": "example",
      "childFolders": [
        {}
      ],
      "childItems": [
        {}
      ],
      "id": "example",
      "name": "example",
      "scope": "example",
      "scopeOwner": "example"
    }
  }
}
```

### List teams

List the teams, with each one's ID.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "teams": [
      {
        "teamId": "example",
        "teamName": "example"
      }
    ]
  }
}
```

### Run One-Step Action

Run a One-Step Action on a record.

**Inputs**

- One-Step Action key (`stand_in_key`, text, required): The One-Step Action's key, from List One-Step Actions.
- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "completed": true,
    "currentPrimaryBusObId": "example",
    "currentPrimaryBusObRecId": "example"
  }
}
```

### Run saved search

Run a saved search by its name and get its records.

**Inputs**

- Business object (`association`, text, required): The business object the searches or actions belong to, by ID.
- Scope (`scope`, text, required): The search's scope, such as Global, Team or User.
- Scope owner (`scope_owner`, text): The scope owner's ID. Leave empty when there is none.
- Search name (`search_name`, text, required): The saved search's name.
- Search text (`search_term`, text): Words to narrow the results.
- Page (`page_number`, number): Which page of results, from 1. At least 1.
- Page size (`page_size`, number): How many to return, 1 to 200. From 1 to 200.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "businessObjects": [
      {
        "busObId": "example",
        "busObPublicId": "example",
        "busObRecId": "example",
        "fields": [
          {
            "dirty": true,
            "displayName": "example",
            "fieldId": "example",
            "name": "example",
            "value": "example"
          }
        ],
        "values": {}
      }
    ],
    "hasMoreRecords": true,
    "hasPrompts": true,
    "totalRows": 1
  }
}
```

### Search records

Find records of a business object by text or by field values, with every field of each.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Search text (`search_text`, text): Words to find in the records.
- Equals (`equals`, object): Fields whose value equals, by field name, such as {"Status": "New"}.
- Contains (`contains`, object): Fields whose value contains, by field name, such as {"ShortDescription": "printer"}.
- Starts with (`starts_with`, object): Fields whose value starts with, by field name, such as {"CustomerDisplayName": "Ann"}.
- Greater than (`greater_than`, object): Fields whose value is greater than, by field name, such as {"Priority": "2"}.
- Less than (`less_than`, object): Fields whose value is less than, by field name, such as {"Priority": "4"}.
- Newest first by (`newest_first_by`, text): A date field to sort by, newest first, such as CreatedDateTime.
- Page (`page_number`, number): Which page of results, from 1. At least 1.
- Page size (`page_size`, number): How many to return, 1 to 200. From 1 to 200.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "businessObjects": [
      {
        "busObId": "example",
        "busObPublicId": "example",
        "busObRecId": "example",
        "fields": [
          {
            "dirty": true,
            "displayName": "example",
            "fieldId": "example",
            "name": "example",
            "value": "example"
          }
        ],
        "values": {}
      }
    ],
    "hasMoreRecords": true,
    "hasPrompts": true,
    "totalRows": 1
  }
}
```

### Transition record

Move a record to another lifecycle status, by a transition from Get lifecycle transitions.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.
- Transition ID (`transition_option_id`, text, required): The transition's ID.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "done": true
  }
}
```

### Unlink related record

Remove the link between two related records. Neither record is deleted.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Record ID (`rec_id`, text, required): The record's record ID (busObRecId), from an earlier step.
- Relationship ID (`relationship_id`, text, required): The relationship's ID, from Get Business Object schema with relationships.
- Related business object (`related_bus_ob_id`, text, required): The related record's business object.
- Related record ID (`related_rec_id`, text, required): The related record's record ID.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "done": true
  }
}
```

### Update record

Change a record's fields. Give its public ID or record ID; fields not named are kept.

**Inputs**

- Business object (`bus_ob_id`, text, required): The business object, such as Incident. Pick one, or give its ID.
- Public ID (`public_id`, text): The record's public ID, the number people see, such as an incident's number.
- Record ID (`rec_id`, text): The record's record ID (busObRecId), from an earlier step.
- Field values (`values`, object, required): Field values by field name, such as {"ShortDescription": "Printer jam"}. Get Business Object schema lists the names.

**Outputs**

- `data` (object): The response from Cherwell Service Management.

**Example output**

```json
{
  "data": {
    "busObId": "example",
    "busObPublicId": "example",
    "busObRecId": "example",
    "fieldValidationErrors": [
      {
        "error": "example",
        "errorCode": "example",
        "fieldId": "example"
      }
    ]
  }
}
```
