Forums

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

Slack Alert when existing issue has a priority change.

Darin Mellor January 4, 2023

Problem: JIRA Alerts are not firing when an issue is created as a P3 (low priority) or P2 (normal priority) and gets upgraded in priority to a P1 (high) or P0 (urgent priority). 

Our team is using the attached automation to alert a specific Slack Channel. It works brilliantly when the issue is created as a P1 or P1, but there are times when the JIRA is created as a P2 or P3 in error and needs to be upgraded/transitioned to a P1/P0.

The goal is to maintain the current automation functionality while also alerting this channel when the priority is upgraded to a P1 or P0. 

Steps taken:

Attempted to add a new connection, but the channel is greyed out as is already in use for the P1/P0 alert. Thus, we wanted to see if we could build upon the existing framework and also alert when the issue is transitioned to a P1/P0 from a P2/P3

JIRA _ Slack Integration.png

2 answers

1 accepted

0 votes
Answer accepted
Mark Segall
Community Champion
January 5, 2023

Hi @Darin Mellor and welcome to the community!

You may want to "flip the script" on this one and instead of automating from Slack, use Jira Automation as it will provide more flexibility with business logic prior to sending messages to Slack.

It would look something like this:

  • TRIGGER: Field Value Changed (Priority)
  • CONDITION: Issue Type Contains Bug, Task
  • CONDITION: Priority Contains P0, P1
  • ACTION: Send Slack Message

This rule would trigger every time the priority is changed.  If the priority is not P0/P1 it quietly exits. If it is P0/P1 then send the slack message.

I hope this helps.

Darin Mellor January 12, 2023

Hey Mark! 


Thank you so much for the help on this! I am running with this and just waiting for an admin to get me the Slack Webhook. If you do not hear back it worked brilliantly. Thank you again for your time in answering this so thoroughly! 

Like Mark Segall likes this
Darin Mellor January 30, 2023

Hey Mark!

 

I am using this page: https://community.atlassian.com/t5/Jira-Software-questions/Slack-Alert-when-existing-issue-has-a-priority-change/qaq-p/2230689#M241830 to try to tailor our messaging, but I do not see a field that specifically ties an issue field that would map to priority as seen here in my test ticket:Priority.png

Our goal is to show the priority of the ticket in our messaging vs saying "A JIRA Ticket has been created as/transitioned to a P1/P0"

 

Please let me know if it would be better to surface this as a different question. Thank you again for your assistance here!

Mark Segall
Community Champion
January 30, 2023

Hi @Darin Mellor - It looks like you linked back to this question so I'm not quite following the issue.

You should be able to set whatever slack message you want.  I should note that as a predecessor, you'll need a webhook for your target slack channel then configure your rule as I provided above and it should give the desired results.

Darin Mellor January 30, 2023

Hi @Mark Segall

 

My apologies, the steps you provided 1000% work very well, and the message posts to the desired slack channel. However, where I am lost is getting the priority of the ticket listed in the message. If we look at the below, it pulls in the ticket name title via {{issue.summary}} and also pulls in the URL/link to the ticket by using {{issue.url}}. However, as seen below, I do not have a way to add {{issue.priority}}, or it is at least not listed here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/ in this JIRA Help Article.

Automation.png

Mark Segall
Community Champion
January 30, 2023

Have you tried this?

{{issue.priority}}

Darin Mellor February 3, 2023

Thank you Mark! 

I tried {{issue.priority}} and it came back with 2 vs P1 - High, which is odd because in Snowflake (https://marketplace.atlassian.com/apps/1227353/snowflake-for-jira?tab=overview&hosting=cloud) it is called "priority_name". 

 

I even tried to map the issue assignee as {{issue.assignee}} and it came back with the JIRA Id for that user vs the user/assignee's name. 

 

Sorry that this has gone off the rails. These are nice fields, and it would be nice to crack those codes, but I am curious why it is giving me different values than what the JIRA UI is displaying. 

Mark Segall
Community Champion
February 3, 2023

Sorry - Forgot that priority brings in the priority ID.  You'll need this to get the priority name:

{{issue.priority.name}}
Darin Mellor February 3, 2023

No worries! Thank you Mark! It worked like a charm. I wish that {{issue.assignee.name}} worked as well, but still had it pull the JIRA ID for me vs my name when testing. 

Mark Segall
Community Champion
February 3, 2023

Oh for assignee you want this:

{{issue.assignee.displayName}}
Darin Mellor February 3, 2023

MARK!  Sir, you are amazing! I sincerely cannot thank you enough! 

Test.png

Like Mark Segall likes this
0 votes
Darin Mellor February 3, 2023

Whoops.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events