# [GitHub to Jira Issue Creation](https://docs.getglow.ai/getting-started/examples/github-jira-sync#github--jira-sync)

> Create Jira issues from GitHub issues in Glow and post the Jira key back as a comment. Learn field mapping and test both writes with sample records.

**Level 1: Fundamentals · about 15 minutes · 3 steps**

Create a Jira issue for each new GitHub issue, then comment back on GitHub with the Jira key. This is one-way issue creation with a backlink, not ongoing synchronization of edits or status.

This automation builds on the earlier mapping work. The final action writes back to the system that started the run, using a value the Jira action produced.

**At a glance**

- **Result:** Create a Jira issue from a GitHub issue and post its key back to GitHub.
- **You need:** Manually configured GitHub and Jira Cloud connections, a test repository and project with the permissions below; Workflow Assistant is optional.
- **Usage:** The manual core uses Step credits, not Glow AI tokens; optional Workflow Assistant help uses AI separately.
- **What changes:** Actual automation runs and authorized action tests create real Jira issues and GitHub comments, so use test records.

GitHub trigger → Jira → Back to GitHub

```mermaid
flowchart LR
    G1[Step 1: GitHub Issue Opened] -->|title, body, html_url| J[Step 2: Jira Create Issue]
    G1 -->|issue.number| G2[Step 3: GitHub Create Comment]
    J -->|Returned Jira Key| G2
```

## Prerequisites

- A connected **GitHub** account with permission to read issues and create comments in a test repository.
- A connected **Jira Cloud** account with permission to create issues in a test project, including its required fields and issue types.

---

## [Building the Automation](https://docs.getglow.ai/getting-started/examples/github-jira-sync#building-the-workflow)

### 1. The Trigger: GitHub (New or Updated Issue)
Drag a **GitHub** trigger onto the canvas and select your target repository. Choose **New or Updated Issue (Instant)** (filtered to `opened` in **Filter Event Types**) or **New or Updated Issue (Polling)**.

Use this sample in the trigger's **Test & Debug** tab to practice mapping. Your GitHub trigger's payload may differ, and you should not run the comment action against this placeholder issue number:

```json
{
  "action": "opened",
  "issue": {
    "number": 42,
    "title": "Authentication fails with 401 on token refresh",
    "body": "When a session token expires, the refresh endpoint returns 401 instead of generating a new token pair.",
    "html_url": "https://example.com/issues/42",
    "user": {
      "login": "octocat"
    }
  }
}
```

### 2. The Action: Jira (Create Issue)

Add a **Jira** action Step and select **Create Issue**. Keep the Step's **Mode** in the `⋮` menu set to **HTTP** to configure its fields manually. Choose the **Connection**, **Cloud ID**, **Project ID**, and **Issue Type** (such as Bug or Task).
In **Additional properties**, supply the summary and description for the sample above:

- `summary`: `{{ 1.issue.title }}`
- `description`: `Reported by @{{ 1.issue.user.login }} in GitHub: {{ 1.issue.html_url }}\n\n{{ 1.issue.body }}`

These paths match the sample and assume the trigger is Step `1`. Once you connect your repository, capture a test issue event on the trigger. Then pick its fields from **Workflow data** to match your repository's exact payload.

### 3. The Loop-Back: GitHub (Add Comment)

Add a second **GitHub** action Step and select **Create Issue Comment**. Choose the same repository and map the issue number (`{{ 1.issue.number }}` in the sample).

Save a real test issue payload on the trigger, set the run point to the trigger, and click **Run** in the dock once. Native app actions return fields directly without a `ret` wrapper. Pick the returned Jira key from **Workflow data** (such as `Tracking this internally as ` plus the key), then connect the comment Step.

> **Adding a reverse automation?** First store a durable mapping between the
> Jira key and GitHub repository and issue number. Then choose a Jira
> status-change trigger and the corresponding GitHub action. Include duplicate
> and loop prevention so changes do not bounce between the two automations.

## Test and go live

Keep the automation in **Draft** and save the payload of a real test GitHub issue (such as `Glow sync test: safe to close`) in the trigger's **Test & Debug** tab. Do not run comment actions against the placeholder issue `#42`.

| Test step                                            | Expected result                                                                                         | Where to check                                                                                                                    |
| :--------------------------------------------------- | :------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------- |
| **1. Saved payload from your test GitHub issue**     | Title, body, URL, and `issue.number` point to your real test issue.                                     | Trigger test data and Jira field mappings.                                                                                        |
| **2. Dock `Run` from the trigger (full Draft run)**  | Creates one Jira issue with the GitHub details and posts one GitHub comment with the returned Jira key. | Jira project, comment Step output, and the test GitHub issue.                                                                     |
| **3. Comment-only retry (if Jira succeeded first)**  | Posts the backlink comment without creating a duplicate Jira ticket.                                    | Authorized isolated action test on **Create Issue Comment** (see [Testing & Debugging](https://docs.getglow.ai/build/the-canvas/testing-and-debugging)). |
| **4. Go Live check: open one new test GitHub issue** | Automatic trigger run creates one Jira issue and posts one matching backlink comment.                   | Automation run history, Jira project, and the new GitHub issue.                                                                   |

> **Dock `Run` vs `Run step`:** Ordinary **Run step** only replays saved output
> and does not create issues or comments. Use dock **Run** from the trigger, or
> an authorized isolated action test if Jira creation already succeeded.

**Verify it works**

- **Run:** Save a real test GitHub issue payload on the trigger and click Run in the dock.
- **You should see:** Jira creates one issue with the GitHub details, and GitHub posts one comment containing the returned Jira key.

## What's Next?

👉 **[Continue to AI Meeting Briefs →](https://docs.getglow.ai/getting-started/examples/meeting-prep-dossier)**

- Build the reverse-direction branch described above with the [Conditions Step](https://docs.getglow.ai/build/action-steps/conditions).
- Map fields between the two systems confidently using [Automation Data](https://docs.getglow.ai/build/core-concepts/workflow-data).
