Automation rules to send Email notifcations to assignee for Before SLA breach Issues in 2 hra in jir
Asked by Kishor Mudhili:

Hi Guys

Automation rules to send Email notifcations to assignee for Before SLA breach Issues in 2 hra in jira clould based on priority

for example: if P1 - we have 1hr . so i want to send remaider to assignee before 30 min

if P2 - we have 4 hrs . so i want to send remainder to assigend before 1 hr etc..

please help me some one. it's bit urgent


Answers:
author: Walter Buggenhout
body: Hi [@Kishor Mudhili](/t5/user/viewprofilepage/user-id/5310742),

You can do this with an automation rule, but just as well with a filter subscription. [This support article](https://confluence.atlassian.com/jirakb/how-to-configure-notifications-for-custom-threshold-before-slas-breach-777027021.html) describes how you can approach this.

In short, define your SLA and use a JQL filter to check for issues with a certain time remaining. Then use that filter and a schedule with a regular frequency to send out the desired notfications.

If you insist on using automation, you can do exactly the same using a scheduled trigger and adding the same JQL statement there to select issues meeting the criteria.

Hope this helps!

comments: author: Kishor Mudhili
body: [@Walter Buggenhout](/t5/user/viewprofilepage/user-id/783225) thank you, **I'm new to JSM**. could you please help me with detailed. because as an admin we need to configure not from users.

so please help me like autoamtion steps and JQL query please


author: Walter Buggenhout
body: Nothing wrong with being new to JSM, [@Kishor Mudhili](/t5/user/viewprofilepage/user-id/5310742). We've all been there. But do take the time effort to read the documentation being shared and try things out. It will help you understand and increase your learning.

An example JQL is in the article I shared. If your SLA is called "Time to Resolution" and you want a list of issues that will breach this SLA in 1 hour, then this JQL should retrieve those issues:

```
"Time to Resolution" != breached() AND "Time to Resolution" <= remaining(1h)
```

To use this in an automation rule, you create a new rule with basically 2 components:

* **Trigger:** scheduled / make it run e.g. every 15 minutes
* **Action:** send email - to assignee. As the body of the issue write something. like this: *This issue {issue.key} - {issue.summary} is about to breach its SLA.*

I don't need to tell you that this may end up as a spammy experience for your users and educate them to (keep working or) work from their email inbox rather than from the tool. Which is definitely not the greatest idea.

It would be much better if you can get your agents to work from JSM queues instead, sorting the tickets there by SLA. Yet again, you can use the exact same JQL filter as the basis for a queue with urgent tickets, so people can find them there in real time, rather than waiting for emails.


author: Kishor Mudhili
body: [@Walter Buggenhout](/t5/user/viewprofilepage/user-id/783225) : thank you so much for your support


author: Joseph Chung Yin
body: [@Kishor Mudhili](/t5/user/viewprofilepage/user-id/5310742) -

I agreed with [@Walter Buggenhout](/t5/user/viewprofilepage/user-id/783225) suggested. On the JQL side, take a look at the following SLA JQL function -

"Time to Resolution" \< remaining("2h") This will give you issues that will breach Time to Resolution in the next two hours.

Here are additional references on JQLs as relating to SLA for JSM

<https://support.atlassian.com/jira-service-management-cloud/docs/use-jira-query-language-jql-to-create-service-level-agreements-slas/>

<https://support.atlassian.com/jira-service-management-cloud/docs/jql-functions/> (To see all functions related to SLA, just search for the word "SLA")

Here is the link on Automation for Jira - <https://support.atlassian.com/cloud-automation/docs/jira-cloud-automation/>

Hope this also helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.


Tags: cloud

jira-service-management

jira-service-management-cloud