Skip to content

Label Missing Jira Info

Label PRs that don't reference a Jira ticket in the title or description. This uses regex to detect Jira ticket formats in the title (e.g. ABC-1234), and URLs to Jira tickets in the description.

Label Missing Jira

Configuration Description

Conditions (all must be true):

  • The PR lacks a Jira ticket number in the title, or a link to a Jira ticket in the PR description.

Automation Actions:

  • Apply a missing-jira label.

Label Missing Jira Info

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  label_missing_jira_info:
    # Triggered for PRs that don't have either a Jira ticket number in the title,
    # or a link to a Jira ticket in the PR description.
    if:
      - {{ not (has.jira_ticket_in_title or has.jira_ticket_in_desc) }}
    run:
      - action: add-label@v1
        args:
          label: "missing-jira"
          color: 'F6443B'

has:
  jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
  jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}