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

# Create Issue Ticket on Jira Self Hosted

Opens one Jira Self-Hosted issue for all the assets the workflow collected. The issue title is the workflow title, and the description lists the workflow description, the asset count and a table of the assets with the columns you selected.

### 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.                                                           |

### How it works

* One request creates one issue for all matched assets. Jira REST API v2 is used (`/rest/api/2/issue`). The summary is the workflow title.
* 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 the issue fields.
* Unless **Create with file as attachment** is on, the description holds the workflow description, `Hostname Count`, a table with one row per asset (columns from **Edit Columns**) and a `Powered by OctoXLabs` footer.
* With **Create with file as attachment** on, the job sends no description. The same text is uploaded to the issue as a file named `octoxlabs-<workflow title>.txt`. A failed upload is only logged and the issue stays.
* If Jira does not answer 201 to the create request, the job fails with the status code and the response text.
* The assets pass on to the next node unchanged.

### Example

A workflow that opens one ticket for all devices found by the condition node, authenticating with a Personal Access Token.

| Setting               | Value                      |
| --------------------- | -------------------------- |
| URL                   | `https://jira.example.com` |
| Username              | (blank)                    |
| Password              | (blank)                    |
| Personal Access Token | `YOUR_API_TOKEN`           |
| 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 Per Asset on Jira Self-Hosted</strong></td><td>One issue for each asset instead of one for all.</td><td><a href="broken://pages/2a07a4874926ccdc4a4c7a16c4b7a10b588b828d">Broken link</a></td></tr><tr><td><strong>Create Issue/Ticket on Jira Cloud</strong></td><td>The same job for Jira Cloud.</td><td><a href="broken://pages/cda6cc755670926b22abb2182cfa7ecc5512f007">Broken link</a></td></tr></tbody></table>

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