Tired of switching tabs between GitHub and Jira?
With this GitHub Action, a pull request will transit Jira issue and bind links on each other.
Auto resolve/fix-ready(or even re-assign issue to reporter) once merged.
If you want, we can even auto create Jira issue on a pull request.
Magically bring your name as assignee, move it in active sprint, and every properties you can imagine.
- create a pull request
- auto insert created issue key into title and desc
- auto create Jira issue with same title
- add
component
,fix version
,active sprint
- record github pull request url
- here is an existed Jira issue
- create a pull request titled with Jira issue key
- auto insert Jira issue link into desc
- auto transit Jira issue
- record github pull request url
Create .github/workflows/jira.yml
on:
pull_request:
types: [opened, closed]
branches:
- master
name: Jira Webhook Integration
jobs:
test:
name: Jira Webhook Integration
runs-on: ubuntu-latest
steps:
- name: Integration
uses: ./
with:
host: ${{ secrets.JIRA_BASE_URL }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
webhook: ${{ secrets.JIRA_WEBHOOK }}
Create .github/workflows/pr-jira.yml
on:
pull_request:
types: [opened]
branches:
- master
name: Pull Request and Jira issue integration
jobs:
jira:
name: Pull Request and Jira issue integration
runs-on: ubuntu-latest
steps:
- name: Pull Request and Jira issue integration
uses: Timmatt-Lee/GitHub-Jira-Integration@master
with:
host: ${{ secrets.JIRA_BASE_URL }}
email: ${{ secrets.JIRA_USER_EMAIL }}
token: ${{ secrets.JIRA_API_TOKEN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
project: ${{ secrets.JIRA_PROJECT_NAME }}
transition: ${{ secrets.JIRA_PR_TRANSITION_NAME }}
type: ${{ secrets.JIRA_ISSUE_TYPE }} # optional, but required if you want to create issue
component: ${{ secrets.JIRA_COMPONENT_NAME }} # optional, created issue property
version: ${{ secrets.JIRA_VERSION_PREFIX }} # optional, created issue property
board: ${{ secrets.JIRA_BOARD_ID }} # optional, sprint detection for created issue
isCreateIssue: true # optional, if you want to auto create issue
isOnlyAppendDesc: true # optional, if you only need update PR description
appendDescAfterRegex: "Jira Issue Link:" # optional, insert link after regex in PR description
Create .github/workflows/merge-jira.yml
on:
pull_request:
types: [closed]
branches:
- master
name: Merge and resolve Jira issue
jobs:
jira:
name: Merge and resolve Jira issue
if: github.event.pull_request.merged
runs-on: ubuntu-latest
steps:
- name: Transit Jira issue
uses: Timmatt-Lee/GitHub-Jira-Integration@master
with:
host: ${{ secrets.JIRA_BASE_URL }}
email: ${{ secrets.JIRA_USER_EMAIL }}
token: ${{ secrets.JIRA_API_TOKEN }}
project: ${{ secrets.JIRA_PROJECT_NAME }}
transition: ${{ secrets.JIRA_MERGE_TRANSITION_NAME }}
isOnlyTransition: true
isAssignToReporter: true # optional, re-assign issue to reporter
otherAssignedTransition: ${{ secrets.JIRA_QA_TRANSITION_NAME }} # optional, trigger when issue is assigned by other
Create GitHub Secrets NOTE: you need admin authorization of your repo
JIRA_BASE_URL
:https://your-domain.atlassian.net
JIRA_USER_EMAIL
: your jira emailJIRA_API_TOKEN
: Create HereJIRA_PROJECT_NAME
: short name of your project(eg.My Project (MP)
,MP
is the project name)JIRA_ISSUE_TYPE
: eg.Task
,Story
...JIRA_BOARD_ID
: for creating issue auto attach to active sprint, you can see it in url of Active sprintsJIRA_COMPONENT_NAME
: component name that creating issue attach toJIRA_VERSION_PREFIX
: for creating issue auto attach to fix version that match the prefix. eg.Backend Cloud v1
JIRA_MERGE_TRANSITION_NAME
: eg.Resolve
JIRA_PR_TRANSITION_NAME
: eg.Start Progress
JIRA_QA_TRANSITION_NAME
: eg.Ready to Fix
JIRA_WEBHOOK
: eg.https://automation.atlassian.com/pro/hooks/19823a981b9b981ba981b2b4b5a
NOTE: you can rename secrets, but don't forget to change corresponding arguments in .yml
# Install dependencies
npm install
# create .env and edit it
mv .env.example .env
# Run the tests
npm test
# Build script
npm run build
Any suggestions or bug report is welcomed to open an issue!
For code contribution, check Contributing Guide.
ISC © 2020 Timmatt-Lee