> 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-self-hosted.md).

# Create Jira Assets Self Hosted

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

### Before you begin

* Jira Service Management Self-Hosted with Assets and a username and password that may create objects.
* 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  | Yes (blank allowed) | None    | Your Jira Self-Hosted URL. Include the scheme, for example `https://jira.example.com`.                                                 |
| Username                    | Text | Yes (blank allowed) | None    | Username for Basic authentication.                                                                                                     |
| Password                    | Text | Yes (blank allowed) | None    | Password for Basic authentication. Secret, but shown as plain text (not masked).                                                       |
| 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>/rest/assets/1.0/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                         | `https://jira.example.com` |
| Username                    | `your-user`                |
| Password                    | `YOUR_API_TOKEN`           |
| 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 Self-Hosted</strong></td><td>A job that maps attributes by name and skips failed assets.</td><td><a href="broken://pages/f02a5df27844778460b014319c6f99649f598325">Broken link</a></td></tr><tr><td><strong>Create Jira Assets Cloud</strong></td><td>The same job for Jira Cloud.</td><td><a href="broken://pages/7fde24cc3f2158643a69949c84e99b48d7e550f4">Broken link</a></td></tr></tbody></table>
