> 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-issue-ticket-per-asset-on-jira-self-hosted.md).

# Create Issue Ticket Per Asset on Jira Self Hosted

Opens one Jira Self-Hosted issue for each asset the workflow collected, so every device gets its own ticket titled with its hostname.

### Before you begin

* A Jira Self-Hosted (Server or Data Center) instance and either a username and password or a Personal Access Token that may create issues in the target project.
* The project key and an issue type that belongs to that project.
* Accepted asset type: `device`. No required columns.
* The device columns you pick in **Edit Columns** are the columns of the table that goes into the issue.
* 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                 | None               | Your Jira Self-Hosted base URL.                                                                                                            |
| Username                       | Text    | Yes (blank allowed) | None               | For Basic authentication. If you use a Personal Access Token, leave Username and Password blank.                                           |
| Password                       | Text    | Yes (blank allowed) | None               | For Basic authentication. Secret. Masked after saving.                                                                                     |
| Personal Access Token          | Text    | Yes (blank allowed) | None               | If you use a Personal Access Token (PAT), leave Username and Password blank. Secret. Masked after saving.                                  |
| Project Key                    | Text    | Yes                 | None               | Key of the target project. Example: `KAN`.                                                                                                 |
| Issue Type                     | JSON    | No                  | `{"name": "Task"}` | Issue type as a dictionary, for example `{"name": "Task"}` or `{"id": "10001"}`. It must be an issue type associated with the Project Key. |
| Assignee Username              | Text    | Yes (blank allowed) | None               | Username of the assignee. Leave blank for no assignee.                                                                                     |
| Custom fields                  | JSON    | No                  | `{}`               | Extra issue fields in JSON, for example `'customfield_10033': 'text'`.                                                                     |
| Create with file as attachment | Boolean | No                  | false              | Attach the asset list as a text file instead of writing it into the description.                                                           |

The settings are the same as for [Create Issue/Ticket on Jira Self-Hosted](broken://pages/cde6efec45f8c748987e22de7cf4b9ca1dfe7617). The difference is the number of issues: this job creates one per asset.

### How it works

* One request per matched asset creates one issue each (`/rest/api/2/issue`). The summary is the asset's `Hostname` value.
* Authentication is a Bearer header when **Personal Access Token** is set, otherwise Basic with **Username** and **Password**.
* The issue goes into **Project Key** with the **Issue Type** you give. **Custom fields** are merged into every issue.
* Unless **Create with file as attachment** is on, each description holds the workflow description and a one-row table for that asset (columns from **Edit Columns**), followed by `Powered by OctoXLabs`. With the option on, that text is uploaded to the issue as a file named `octoxlabs-<workflow title>.txt` instead.
* An asset whose issue cannot be created is logged and skipped. The job fails only when no issue could be created for any of the matched assets. With no matched assets it does nothing.
* The assets pass on to the next node unchanged.

### Example

A workflow that opens a separate ticket for every device the condition node matched.

| Setting               | Value                      |
| --------------------- | -------------------------- |
| URL                   | `https://jira.example.com` |
| Username              | `your-user`                |
| Password              | `YOUR_API_TOKEN`           |
| Personal Access Token | (blank)                    |
| Project Key           | `SEC`                      |
| Issue Type            | `{"name": "Task"}`         |

### 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 Issue/Ticket on Jira Self-Hosted</strong></td><td>One issue for all assets instead of one per asset.</td><td><a href="broken://pages/cde6efec45f8c748987e22de7cf4b9ca1dfe7617">Broken link</a></td></tr><tr><td><strong>Create Issue/Ticket Per Asset on Jira Cloud</strong></td><td>The same job for Jira Cloud.</td><td><a href="broken://pages/f9e3330491510ab92a652b9d9dec80a7791f51b7">Broken link</a></td></tr></tbody></table>

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