Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Issue ticket in Jira via airflow dag when the dag status is fail?

abhishek raj
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 20, 2021

Hi,

I would like to create a ticket whenever the dag status is fail with dag ID.
I would like to do it without any third party library in python not sure if this is possible or not.
I have work around Jira hook and operators from airflow 2.0 using below as reference.

wanted to know its right way to do and how can i achieve this.

https://github.com/BranchMetrics/incubator-airflow/blob/master/tests/contrib/operators/test_jira_operator_test.py

https://stackoverflow.com/questions/65846976/passing-xcom-value-to-jiraoperator-in-airflow

1 answer

0 votes
Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2021

Hi @abhishek raj 

If you are willing to write the code, you can add a rest api script that runs at intervals and pools tickets or is fired when your conditions are met in the source.

You can read about Jira cloud rest api here: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/

Make sure you decide if the if is parsed before hand.

abhishek raj
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 20, 2021

Thanks @Ismael Jimoh 

Suggest an answer

Log in or Sign up to answer