> 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/jira/create-jira-assets-cloud.md).

# Create Jira Assets Cloud

Creates one Jira Assets object for each device the workflow collected, in Jira Service Management Cloud, filling hostname, OS version and IP address attributes by attribute id.

### Before you begin

* Jira Service Management Cloud with Assets, an Atlassian account email, an API key and the Assets workspace id.
* Accepted asset type: `device`.
* Required columns: `Hostname`, `OS.Major`, `OS.Minor`, `OS.Build` and `IpAddresses`. Assets missing any of them (or with an empty value) are left out.
* Defaults you saved for this job in [Action Center Settings](broken://pages/c24f789e38de30d1826122b3a82f349153f232b9) 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  | No                  | `api.atlassian.com` | Assets API host. Example: `api.atlassian.com`.                                                                                         |
| Email                       | Text | Yes (blank allowed) | None                | Email of the Atlassian account used for Basic authentication.                                                                          |
| Api Key                     | Text | Yes (blank allowed) | None                | API key (token) of that account. Secret, but shown as plain text (not masked).                                                         |
| Workspace ID                | Text | Yes (blank allowed) | None                | Assets workspace id. Example: `asd123-asd123-asd123`.                                                                                  |
| Object Type ID              | Text | Yes                 | None                | Assets object type to create. Example: `11`. It corresponds to the Category field in OctoXLabs.                                        |
| Attribute Id for IpAddress  | Text | Yes                 | None                | Id of the object type attribute that receives the IP addresses. If you do not have the attribute, create a new one. It should be text. |
| Attribute Id for Hostname   | Text | Yes                 | None                | Id of the object type attribute that receives the hostname. If you do not have the attribute, create a new one. It should be text.     |
| Attribute Id for Os Version | Text | Yes                 | None                | Id of the object type attribute that receives the OS version. If you do not have the attribute, create a new one. It should be text.   |

### How it works

* The job sends one create request per matched asset to `<URL>/jsm/assets/workspace/<Workspace ID>/v1/object/create`, authenticated with Basic authentication.
* Each object gets the hostname, the OS version as `<OS.Major>.<OS.Minor>.<OS.Build>` and the IP addresses joined with a comma and a space. You give attribute ids, not names.
* The job stops at the first response that is not 201. It logs the URL, payload and response, and objects for the remaining assets are not created. The code only logs this error and does not raise it.
* The assets pass on to the next node unchanged.

### Example

Create an Assets object for every matched device.

| Setting                     | Value                   |
| --------------------------- | ----------------------- |
| URL                         | `api.atlassian.com`     |
| Email                       | `your-user@example.com` |
| Api Key                     | `YOUR_API_TOKEN`        |
| Workspace ID                | `YOUR_WORKSPACE_ID`     |
| Object Type ID              | `11`                    |
| Attribute Id for Hostname   | `80`                    |
| Attribute Id for IpAddress  | `81`                    |
| Attribute Id for Os Version | `82`                    |

### 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/08e1c051f3c3fc15c184408533696e2939698d56">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/c24f789e38de30d1826122b3a82f349153f232b9">Broken link</a></td></tr><tr><td><strong>Create Insight Asset Per Asset on Jira Cloud</strong></td><td>A job that maps attributes by name and skips failed assets.</td><td><a href="broken://pages/39a8566dc8fc5cea1f98e582bd458b732a89e207">Broken link</a></td></tr><tr><td><strong>Create Jira Assets Self-Hosted</strong></td><td>The same job for Jira Self-Hosted.</td><td><a href="broken://pages/51ede7a671edc41161369e59bba7958d0223111c">Broken link</a></td></tr></tbody></table>
