Read Anthropic’s case study about Graphite Reviewer

Integrating GitHub Actions with Jira

Sara Verdi
Sara Verdi
Graphite software engineer
Try Graphite


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


Integrating GitHub Actions with Jira can significantly streamline your workflow by automating tasks between these two platforms. This guide will take a look into how to set up this integration effectively and how to leverage Graphite Automations to level up your workflow.

Before starting, make sure you have the necessary access to both your GitHub repository and Jira account. You'll need administrative rights in Jira to create and manage automation rules and at least maintainer rights in GitHub to manage workflows.

To automate interactions between GitHub and Jira, you'll start by setting up a GitHub Action:

  1. Create a new workflow file in your repository under .github/workflows/. You can name it jira-integration.yml.
  2. Define the workflow that triggers when certain GitHub events occur, such as issues being opened, pull requests being updated, or specific labels being applied.

Example workflow file:

Terminal
name: Jira Integration
on:
pull_request:
types: [opened, reopened, synchronize]
issues:
types: [opened, labeled]
jobs:
integrate-with-jira:
runs-on: ubuntu-latest
steps:
- name: Link PRs and Issues to Jira
uses: atlassian/gajira-login@v2.0.0
with:
username: ${{ secrets.JIRA_USERNAME }}
password: ${{ secrets.JIRA_TOKEN }}
- name: Create Jira issue
uses: atlassian/gajira-create@v2.0.1
with:
project: 'PROJ'
issuetype: 'Task'
summary: 'New Issue from GitHub: ${{ github.event.issue.title }}'
description: 'This task was automatically created from an issue in GitHub: ${{ github.event.issue.html_url }}'

This example shows a workflow that connects GitHub issues and pull requests to Jira tasks automatically.

In Jira, set up automation rules to respond to changes triggered by GitHub:

  1. Navigate to Project settings > Automation in your Jira project.
  2. Create a new rule with a trigger based on the receipt of a webhook from GitHub.
  3. Define actions such as updating an issue status or adding a comment when the GitHub workflow runs.

Example Jira automation:

  • Trigger: Issue updated from GitHub
  • Action: Transition issue to "In Progress"

Graphite Automation's capabilities can further enhance this workflow by handling more granular actions based on the specifics of the pull requests:

  • Automate reviewer assignments based on file paths or code ownership.
  • Automate notifications through platforms like Slack when specific GitHub events occur related to a Jira ticket.

To set up Graphite Automations, navigate to the Automations section in the Graphite web app, create a rule, specify your repository, and define the conditions and actions for your PRs. This integration ensures that repetitive tasks are automated, saving time and maintaining consistency.

After setting up the integration, thoroughly test the workflows and automation rules to ensure they perform as expected. Adjust the configurations based on real-world interactions to refine the process.

By linking GitHub Actions with Jira, teams can:

  • Reduce manual effort by automating task synchronization between development and project management tools.
  • Increase visibility into project status, ensuring updates in GitHub reflect immediately in Jira.
  • Improve collaboration between teams by maintaining a single source of truth for project statuses and tasks.

Leveraging GitHub Actions for Jira integration streamlines your development workflow, making it more efficient and effective. With the additional power of Graphite Automations, you can further enhance the capabilities of this integration, automating common actions like reviewer assignments and notifications.

Git inspired
Graphite's CLI and VS Code extension make working with Git effortless.
Learn more

Built for the world's fastest engineering teams, now available for everyone