Forums

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

How to send a notification with a new field value that is changed upon ticket creation?

Leyla Kinaze
Contributor
June 3, 2024

Hi, 

 

Upon a ticket creation, the priority of the ticket is changed  based on the IMPACT and the URGENCY fields using a JQL condition:

  • (impact in ("Extensive / Widespread") and urgency in (critical, high)) 

 

The Priority is set to Blocker

 

After this field is changed, I need to send a notification with some of the ticket fields, including the new priority field:

 

  • :alert: *New Production Incident* raised {{issue.url}}, for *Component* {{issue.components.name}}, *Reporter* is {{reporter.displayName}}, *current status* {{issue.status.name}}, *priority* {{issue.priority.name}} 

 

When I do this, I always get a notification with the default value of the priority not the updated priority value set in the automation rule.

How can I get the new priority value to be sent in the notification instead of the default value?  Any hint/help would be greatly appreciated.

 

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
June 3, 2024

Hello @Leyla Kinaze 

Welcome to the Atlassian community.

What mechanism are you using to change the priority value? Is that a workflow Post Function or perhaps an Automation Rule?

What mechanism are you using to send the notifications? Is that coming from the built in Notification configuration, or is that coming from a rule?

If either of these is handled by an Automation Rule, please show us all the details of the automation rule.

Leyla Kinaze
Contributor
June 4, 2024

Hi @Trudy Claspill 

Here are all the details:

As part of an automation rule upon ticket creation, I use the Urgency field and Impact field available in my project to set the priority value.

To change the priority value, I'm using an if matches a JQL query.  I first set the Priority based on the Urgency and Impact field (cf 12902), once that's done, then I send a slack notification.  The slack notification always has the default priority not the updated value.  However, when I look at the ticket once created, the priority value is properly set as per the automation rules.  

Here are the rules used in the automation:


+ When: Issue created
    Rule is run when an issue is created.

< If: matches
   (cf[12902] in ("Extensive / Widespread") and urgency in (critical, high)) or (cf[12902] in ("Significant / Large") and urgency in (critical))

    Then: Edit issue fields
    Priority = Bloquer

< Else-if: matches
   (cf[12902] in ("Extensive / Widespread") and urgency in (medium)) or (cf[12902] in ("Significant / Large") and urgency in (high, medium)) or (cf[12902] in ("Moderate / Limited") and urgency in (critical))

   Then: Edit issue fields
   Priority = High


<Else-if: matches
(cf[12902] in ("Extensive / Widespread", "Significant / Large") and urgency in (low)) or (cf[12902] in ("Moderate / Limited") and urgency in (high, medium)) or (cf[12902] in ("Minor / Localized") and urgency in (Critical))

   Then: Edit issue fields
   Priority = Medium

<Else-if: matches
   (cf[12902] in ("Moderate / Limited") and urgency in (low)) or (cf[12902] in ("Minor / Localized") and urgency in (high, medium, low))

   Then: Edit issue fields
   Priority = Low


If: matches
    Issue Type equals Incident

   Then: Send Slack message
   :alert: *New Production Incident* raised {{issue.url}}, for *Component* {{issue.components.name}}, *Reporter* is {{reporter.displayName}}, *current status* {{issue.status.name}}, *priority* {{issue.priority.name}}


Else-if: matches
   Issue Type equals Problem

   Then: Send Slack message
   :alphabet-yellow-exclamation: *New non-production problem* raised {{issue.url}}, for *component*{{issue.components.name}}, *Reporter* is {{reporter.displayName}}, *current status* {{issue.status.name}}, *priority* {{issue.priority.name}}

Else-if: matches
   Issue Type equals Task

   Then: Send Slack message
:alphabet-white-question: *New question/Support* ticket raised {{issue.url}}, for *component* {{issue.components.name}}, *reporter* is {{reporter.displayName}}, *current status* {{issue.status.name}}, *priority* {{issue.priority.name}}


Let me know if more information is needed.  Thank you!

Trudy Claspill
Community Champion
June 4, 2024

Hello @Leyla Kinaze 

After changing the value in the issue, and prior to sending the Slack message, you need to add a Re-fetch issue data action.

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Re-fetch-issue-data

Leyla Kinaze
Contributor
June 4, 2024

Thank you @Trudy Claspill - that did it!!! :-)

Suggest an answer

Log in or Sign up to answer