JIRA integration
Integrate Junie CLI into your Atlassian JIRA workflows to automatically implement features and fix issues according to the tasks in JIRA issues.
How it works
When a JIRA issue is created or updated with a pre-configured trigger, a Junie GitHub Action workflow is started via workflow_dispatch.
Junie receives the issue details (key, summary, description, user discussion in the comments, and files/screenshots/diagrams attached to the issue), creates a GitHub PR with the required changes, and adds a comment to the JIRA issue with the PR link. The issue state is changed to In Progress when Junie starts working and then to In Review when it is finished.
Setup
On the GitHub side
Configure the GitHub project where the Junie GitHub Action will be run:
Add the following secrets to your GitHub repository in Settings → Secrets and variables → Actions.
Secret
Description
Required
JUNIE_API_KEYThe API key for Junie CLI generated at junie.jetbrains.com/cli.
Yes
JIRA_EMAILThe email address registered for your JIRA account.
Yes
JIRA_API_TOKENThe JIRA API token created in the settings of your Atlassian account.
Yes
JIRA_BASE_URLThe URL of your JIRA instance, for example,
https://your-company.atlassian.net.Yes
JIRA_TRANSITION_IN_PROGRESSCustom transition ID for the In Progress status (default:
21).No
JIRA_TRANSITION_IN_REVIEWCustom transition ID for the In Review status (default:
31).No
Copy and add the
.github/workflows/junie-jira.ymlworkflow file to your GitHub repository.name: Junie Jira Integration on: workflow_dispatch: inputs: action: description: 'Action type' default: 'jira_event' required: true type: string issue_key: description: 'Jira issue key (e.g., TEST-1)' required: true type: string issue_summary: description: 'Jira issue summary/title' required: true type: string issue_description: description: 'Jira issue description' required: false type: string issue_comments: description: 'Jira issue comments' required: false issue_attachments: description: 'Jira issue attachments' required: false jobs: junie: runs-on: ubuntu-latest permissions: contents: write pull-requests: write issues: write if: ${{ inputs.action == 'jira_event' }} steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 1 - name: Run Junie id: junie uses: JetBrains/junie-github-action@v0 with: junie_api_key: ${{ secrets.JUNIE_API_KEY }} jira_base_url: ${{ secrets.JIRA_BASE_URL }} jira_email: ${{ secrets.JIRA_EMAIL }} jira_api_token: ${{ secrets.JIRA_API_TOKEN }} # jira_transition_in_progress: ${{ secrets.JIRA_TRANSITION_IN_PROGRESS }} # jira_transition_in_review: ${{ secrets.JIRA_TRANSITION_IN_REVIEW }}
On the JIRA side
In your JIRA project, configure automation rules in Project settings → Automation:
In Manage secrets (or organization-level Automation secrets), add a new secret named
GITHUB_TOKENthat will be used to authorize requests to the GitHub API from automation rules in JIRA.As the value, provide a GitHub Personal Access Token (classic or fine-grained) with at least
workflowscope (andrepofor private repositories). This token will be referenced in headers as{{secrets.GITHUB_TOKEN}}.Create an automation rule with a trigger of your choice (for example, Label added (such as
junie-agent) or Issue created) to trigger the workflow.Add a Send web request action with the following configuration:
URL:
https://api.github.com/repos/{owner}/{repo}/actions/workflows/junie-jira.yml/dispatchesMethod:
POSTHeaders:
Authorization: Bearer {{secrets.GITHUB_TOKEN}} Content-Type: application/jsonBody (Custom data):
{ "ref": "YOUR DEFAULT BRANCH(main/master for example)", "inputs": { "action": "jira_event", "issue_key": "{{issue.key}}", "issue_summary": "{{issue.summary.jsonEncode}}", "issue_description": "{{issue.description.jsonEncode}}", "issue_comments": "[{{#issue.comments}}{\"author\":\"{{author.displayName.jsonEncode}}\",\"body\":\"{{body.jsonEncode}}\",\"created\":\"{{created}}\"}{{^last}},{{/}}{{/}}]", "issue_attachments": "[{{#attachment}}{\"filename\":\"{{filename.jsonEncode}}\",\"mimeType\":\"{{mimeType}}\",\"size\":{{size}},\"content\":\"{{content}}\"}{{^last}},{{/}}{{/}}]" } }