How to ensure Jira Automation "Deployment successful" is triggered once for the same issue?

Maureen Wang
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!
October 4, 2024

We have integrated Github and Jira, and are able to see the execution of the Github action deployed to the QA environment in the "Deployments" Tab within the issue.

Therefore, we use Jira Automation to send a web request notification to Teams app when Jira Automation triggers "Deployment successful" event, the notification message includes the corresponding issue information.

After setting up this automation rule, notifications are sent, included issue information. However, some issues receive duplicate notifications. Thus, we would like to know how to configure the rule conditions to ensure that "issues included in the same deployment only send one notification."

In our Github repository, the ways we connected with Jira is as follows:

  1. Branch name contains the issue key
  2. PR title contains the issue key
  3. PR description contains the issue key
  4. Some commits contain the issue key

For example, I open a PR with information below:
1. branch name `JRA-123`
2. PR title `JRA-123: Fix some bugs`
3. PR description: `https://jra.atlassian.net/browse/JRA-123`

Once I merge the PR into develop, develop branch will have a commit `merge Pull Request #1 from JRA-123`, then I manually trigger github action to deploy develop branch to testing environment.

When deployment successfully, Jira Automation will send notification for issue `JRA-123` twice, which I expect to send only once.

I'd like to know whether we add too many issue keys information in a single PR which leads Jira to trigger multiple "deployment successfully" events for the same ticket in a single deployment. Thank you.

1 answer

0 votes
Dick
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.
October 4, 2024

Hi @Maureen Wang , welcome to the Atlassian Community

A solution to your query would be to have a custom field in Jira that holds the status of the deployment for a certain issue. Check for non-deployed prior to sending the notification. If it already was deployed, then withhold sending the notification. 

 

Hope this helps you in keeping notifications and deployments in check,

Dick

By voting for helpful posts and marking answers to your question, you're helping people with similar questions find a solution more quickly. Sharing is caring applies to knowledge as well :)

 

Maureen Wang
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!
October 7, 2024

Thank you for the suggestion!

Since in our case, an issue may be deployed to the QA environment multiple times, we need to ensure that a notification is sent after each successful deployment, which makes updating the status not the most suitable approach.

I found that multiple notifications were sent because, in the same deployment, three jobs are run, and the deployment URL is sent with each job, so there can be up to three notifications. To solve this, I decided to create a custom field to store the part of the GitHub deployment URL before /job. If the issue already contains this URL, the notification won't be sent again.

Dick
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.
October 7, 2024

Hi @Maureen Wang 

I'm glad you even managed to put very useful information in the custom field. Even better than the status I suggested! 

Glad this was useful. Let's tell it to the world by marking the answer!

Dick

By voting for helpful posts and marking answers to your question, you're helping people with similar questions find a solution more quickly. Sharing is caring applies to knowledge as well :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events