Hamburger Cross Icon
Jira Collector - Lunar Collector

Jira Collector

Collector Stable Vcs

Extract Jira ticket references from pull request titles, validate them against the Jira REST API, and detect ticket reuse across PRs.

Add jira to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/jira@v1.0.0

What This Integration Collects

This integration includes 2 collectors that gather metadata from your systems.

Collector code

ticket

Extracts Jira ticket ID from PR title, fetches issue metadata from the Jira REST API, and writes normalized ticket data to .vcs.pr.ticket and native Jira data to .vcs.pr.ticket.native.jira.

jira ticket pr issue tracking
Book a demo
Collector code

ticket-history

Queries the Lunar SQL database to count how many other PRs reference the same ticket. Writes .vcs.pr.ticket.reuse_count for policy evaluation. Detects ticket recycling abuse.

jira ticket reuse compliance audit
Book a demo

How Collectors Fit into Lunar

Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.

Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.

Learn How Lunar Works
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "vcs": {
    "pr": {
      "ticket": {
        "id": "ABC-123",
        "source": { "tool": "jira", "integration": "api" },
        "url": "https://acme.atlassian.net/browse/ABC-123",
        "valid": true,
        "status": "In Progress",
        "type": "Story",
        "summary": "Implement payment validation",
        "assignee": "jane@acme.com",
        "reuse_count": 0,
        "native": {
          "jira": { "...full Jira API response..." }
        }
      }
    }
  }
}

Configuration

Configure this collector in your lunar-config.yml.

Inputs

Input Required Default Description
ticket_prefix Required Character(s) before the ticket ID in PR titles (empty = match anywhere)
ticket_suffix Required Character(s) after the ticket ID in PR titles (empty = match anywhere)
ticket_pattern Optional [A-Za-z][A-Za-z0-9]+-[0-9]+ Regex pattern for ticket ID (without prefix/suffix)
jira_base_url Required Jira instance base URL (e.g. https://acme.atlassian.net)
jira_user Required Jira user email for API authentication

Secrets

This collector requires the following secrets to be configured in Lunar:

Secret Description
JIRA_TOKEN Jira API token for authentication
GH_TOKEN GitHub token for reading PR metadata

Documentation

View on GitHub

Jira Collector

Extract Jira ticket references from pull request titles and validate them against the Jira REST API.

Overview

This collector parses PR titles for Jira ticket IDs (e.g. [ABC-123] Fix bug), validates the ticket against the Jira REST API, and writes both normalized ticket data to .vcs.pr.ticket and native Jira data to .jira. It also detects ticket reuse across PRs by querying the Lunar SQL database.

Collected Data

This collector writes to the following Component JSON paths:

Path Type Description
.vcs.pr.ticket object Normalized ticket reference (id, source, url, valid)
.jira.ticket object Normalized Jira ticket metadata (key, status, type, summary, assignee)
.jira.ticket_reuse_count number Count of other PRs referencing the same ticket
.jira.native object Full raw Jira API response

Collectors

This integration provides the following collectors (use include to select a subset):

Collector Description
ticket Extracts ticket ID from PR title and fetches Jira issue metadata
ticket-history Queries Lunar SQL for ticket reuse count across PRs

Installation

Add to your lunar-config.yml:

collectors:
  - uses: github://earthly/lunar-lib/collectors/jira
    on: ["domain:your-domain"]
    with:
      jira_base_url: "https://acme.atlassian.net"
      jira_user: "user@acme.com"

Required secrets:

  • JIRA_TOKEN — Jira API token
  • GH_TOKEN — GitHub token for reading PR metadata

Open Source

This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.

View Repository

Ready to Automate Your Standards?

See how Lunar can turn your engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.

Works with any process
check Infrastructure conventions
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Turn any process doc into guardrails
Book a Demo