> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/action-center/opentext-smax/create-update-entity.md).

# Create Update Entity

Creates or updates any OpenText SMAX entity (Incident, Request, Change, Problem and others) for all the assets the workflow collected, through the EMS REST API. You choose the entity type and the operation.

### Before you begin

* An OpenText SMAX tenant and a user (login and password) that may create the entity in the EMS REST API.
* Accepted asset type: `device`. No required columns.
* The device columns you pick in **Edit Columns** are the columns of the asset report in the description.
* Defaults you saved for this job in [Action Center Settings](broken://pages/c8a849ebb9e0ec0dc85759a136bbbb8a5f105a16) pre-fill the node form. Options you leave out are filled from them when you save the node.

### Settings

These are the fields of the job node form.

| Setting                             | Type    | Required | Default    | Description                                                                                                                                                                                      |
| ----------------------------------- | ------- | -------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| URL                                 | URL     | Yes      | None       | OpenText SMAX base URL. Example: `https://smax.example.com`.                                                                                                                                     |
| Tenant ID                           | Text    | Yes      | None       | SMAX `TENANTID`, used for authentication and in the EMS bulk path.                                                                                                                               |
| Login                               | Text    | Yes      | None       | SMAX username or email used for authentication.                                                                                                                                                  |
| Password                            | Text    | Yes      | None       | SMAX password. Secret. Masked after saving.                                                                                                                                                      |
| Title (DisplayLabel)                | Text    | No       | None       | Ticket title. Defaults to the workflow title if left blank.                                                                                                                                      |
| Description                         | Text    | No       | None       | Ticket description (HTML). The asset report is appended automatically.                                                                                                                           |
| Include Asset Report in Description | Boolean | No       | true       | Append the matched assets (count and columns) to the ticket description.                                                                                                                         |
| Entity Properties                   | JSON    | No       | `{}`       | Additional EMS entity properties merged into the payload. Fields you fill in above take precedence. Example: `{"PhaseId": "Log", "ProcessId": "normal", "RegisteredForActualService": "10916"}`. |
| Entity Type                         | Text    | No       | `Incident` | EMS entity type to operate on. Examples: `Incident`, `Request`, `Change`, `Problem`.                                                                                                             |
| Operation                           | Choice  | No       | `CREATE`   | EMS bulk operation. Choices: `CREATE`, `UPDATE`.                                                                                                                                                 |

### How it works

* The job signs in with `POST <URL>/auth/authentication-endpoint/authenticate/token?TENANTID=<Tenant ID>` and then sends one request to `<URL>/rest/<Tenant ID>/ems/bulk` with a single `<Entity Type>` entity and the operation `<Operation>`. One entity is created for all matched assets.
* Properties start from **Entity Properties**. The fields you fill in above replace the matching properties.
* The title is **Title (DisplayLabel)**, else `DisplayLabel` from Entity Properties, else the workflow title.
* The description is **Description**, else `Description` from Entity Properties, else the workflow description. With **Include Asset Report in Description** on, `Hostname Count`, a header row with your columns (**Edit Columns**) and one row per asset are appended. The report is cut to keep the request under about 1 MB, and a line states how many assets were omitted.
* This job adds no default properties. It sends exactly what you enter, so supply everything the entity needs (for example the phase) in **Entity Properties**.
* If SMAX answers with a status other than 200 or 201, or the bulk `completion_status` is not `OK`, the job logs the error and the code does not raise it. A failed sign-in does raise an error.
* The assets pass on to the next node unchanged.
* The job does not look an entity up. For `UPDATE` it sends the properties as they are, so identify the entity in **Entity Properties**.

### Example

Create an Incident with fixed properties.

| Setting           | Value                                       |
| ----------------- | ------------------------------------------- |
| URL               | `https://smax.example.com`                  |
| Tenant ID         | `YOUR_TENANT_ID`                            |
| Login             | `your-user@example.com`                     |
| Password          | `YOUR_API_TOKEN`                            |
| Entity Type       | `Incident`                                  |
| Operation         | `CREATE`                                    |
| Entity Properties | `{"PhaseId": "Log", "ProcessId": "normal"}` |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>About Action Center</strong></td><td>Workflows, triggers, conditions and job nodes.</td><td><a href="broken://pages/6d6d02e4327768ba6444eaf367143267032d1881">Broken link</a></td></tr><tr><td><strong>Action Center Settings</strong></td><td>Save default values for this job.</td><td><a href="broken://pages/c8a849ebb9e0ec0dc85759a136bbbb8a5f105a16">Broken link</a></td></tr><tr><td><strong>Create Incident</strong></td><td>Create an Incident with sensible defaults.</td><td><a href="broken://pages/11272dee827a90723e717247edeaf30567a774b9">Broken link</a></td></tr><tr><td><strong>Create Change</strong></td><td>Create a Change.</td><td><a href="broken://pages/33ded8303d5a7340a3b4691ed3a32d4ab158f5ba">Broken link</a></td></tr></tbody></table>

{% hint style="info" %}
Available starting from version 6.6.1.
{% endhint %}
