Apache Airflow Atlassian Jira Provider

3.3.3 · active · verified Mon Apr 13

The `apache-airflow-providers-atlassian-jira` package is an Apache Airflow provider that enables seamless integration with Atlassian Jira. It offers operators, sensors, and hooks to interact with Jira for automating tasks like issue creation, updates, and monitoring. As a community-managed provider, it follows Apache Airflow's release cadence, typically releasing minor updates every 2-3 months. The current version is 3.3.3.

Warnings

Install

Imports

Quickstart

This example DAG demonstrates how to create a Jira issue using the `JiraOperator`. It requires a pre-configured Airflow connection to Jira, typically using API Token authentication. Replace `YOUR_PROJECT_KEY` with an actual Jira project key.

from __future__ import annotations

import os
from datetime import datetime

from airflow.models.dag import DAG
from airflow.providers.atlassian.jira.operators.jira import JiraOperator

# Ensure you have an Airflow Connection named 'jira_default' configured.
# For a Jira API Token connection, use:
# Conn Id: jira_default
# Conn Type: Jira
# Host: https://your-jira-instance.atlassian.net
# Login: your_email@example.com
# Password: your_api_token

JIRA_CONN_ID = os.environ.get('AIRFLOW_JIRA_CONN_ID', 'jira_default')
JIRA_PROJECT_KEY = os.environ.get('AIRFLOW_JIRA_PROJECT_KEY', 'YOUR_PROJECT_KEY')

with DAG(
    dag_id='jira_create_issue_example',
    start_date=datetime(2023, 1, 1),
    schedule=None,
    catchup=False,
    tags=['jira', 'example'],
) as dag:
    create_jira_issue = JiraOperator(
        task_id='create_jira_issue',
        jira_conn_id=JIRA_CONN_ID,
        jira_method='create_issue',
        jira_method_args={
            'fields': {
                'project': {'key': JIRA_PROJECT_KEY},
                'summary': 'Airflow Automated Issue: Task Completed',
                'description': 'This issue was created by an Airflow DAG to log a completed task.',
                'issuetype': {'name': 'Task'},
            }
        },
    )

view raw JSON →