Skip to content

appleboy/go-jira

Repository files navigation

go-jira

繁體中文 | 簡體中文

Jira integration with GitHub or Gitea Action for JIRA Data Center.

Table of Contents

Motivation

Since there isn't an official Jira API integration available for GitHub Actions, and considering that Jira offers both Cloud and Data Center versions with different API implementations, this project will initially focus on the Data Center API version. This will help those who have the enterprise version to automatically integrate Jira Issue status updates through CI/CD.

The goal of this project is to make it easy to integrate Jira with GitHub or Gitea Actions for Jira Data Center.

Configuration

Authentication

  • Basic Auth: Set JIRA_USERNAME and JIRA_PASSWORD
  • Token Auth: Set JIRA_TOKEN
  • Skip SSL Verification: Set JIRA_INSECURE=true (not recommended for production)

Environment Variables

Variable Description
JIRA_BASE_URL Jira instance base URL (e.g. https://jira.example.com)
JIRA_USERNAME Jira username (for basic auth)
JIRA_PASSWORD Jira password (for basic auth)
JIRA_TOKEN Jira API token (for token auth)
JIRA_INSECURE Set to true to skip SSL certificate verification
REF Reference string (e.g. git ref/tag/commit message)
ISSUE_FORMAT Custom regex for issue key matching (optional)
TRANSITION Target status name for issue transition
RESOLUTION Resolution name (e.g. Fixed, optional)
ASSIGNEE Username to assign the issue to (optional)
COMMENT Comment to add to the issue (optional)
MARKDOWN Set to true to convert comment from Markdown to Jira format
DEBUG Set to true to enable debug output

Usage

Transition issue status and set resolution

export JIRA_BASE_URL="https://jira.example.com"
export JIRA_TOKEN="your_api_token"
export TRANSITION="Done"
export RESOLUTION="Fixed"
export REF="refs/tags/v1.0.0"
go run cmd/go-jira/main.go

Assign issue and add Markdown comment

export ASSIGNEE="johndoe"
export COMMENT="## Issue fixed\n* Added tests\n* Improved performance"
export MARKDOWN="true"
go run cmd/go-jira/main.go

Show version

go run cmd/go-jira/main.go -version

Use custom environment file

go run cmd/go-jira/main.go -env-file=custom.env

About

Jira integration with GitHub or Gitea Action for JIRA Data Center

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages