Forums

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

Automation rule: Send alert to slack for unsolved ticket by assignee

Nguyen Thanh Tien
Contributor
September 29, 2024

I've set up an alert in Slack as shown in image (1) and received the result in image (2). Is there a way to count the number of unsolved tickets by assignee and compile a list of ticket IDs into a single message, rather than sending multiple messages for each ticket ID?

image 1

Screenshot at Sep 29 15-42-01.png

image 2

Screenshot at Sep 29 15-43-58.png

 

2 answers

1 accepted

3 votes
Answer accepted
Bill Sheboy
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.
September 29, 2024

Hi @Nguyen Thanh Tien 

Depending upon the JQL in your Scheduled trigger, this is likely possible.

You could remove the JQL from the trigger, just having it run every 5 minutes.  Then use the Lookup Issues action to first check if there are issues for which to send notifications, and then branch over the distinct assignees to send the message.

Please see this article which describes the same technique, except for sending an email, and you may modify it to meet your needs: https://confluence.atlassian.com/jirakb/automation-to-send-email-only-once-per-assignee-1310985609.html

Regarding the count of issues, once you branch for each assignee and lookup for only their issues, the count will be:

{{lookupIssues.size}}

 

Kind regards,
Bill

Nguyen Thanh Tien
Contributor
September 29, 2024

Thanks @Bill Sheboy 

Could you please advise on how to hyperlink the key ID instead of displaying the full URL? Additionally, can we add a new line for each ID?

My markdown:

- Ticket {{lookupIssues.key}}: {{lookupIssues.url}} 

The result:

Screenshot at Sep 30 10-57-54.png

Bill Sheboy
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.
September 30, 2024

I have not used Slack in a while and I recommend checking their documentation on hyperlink formatting.

Like Nguyen Thanh Tien likes this
1 vote
Olha Yevdokymova_SaaSJet
Atlassian Partner
September 30, 2024

Hello @Nguyen Thanh Tien 
From the screenshots, it looks like your current setup sends separate Slack messages for each unresolved ticket. To compile all unresolved tickets into a single Slack message, you can use the "Lookup Issues" action in Jira Automation to gather all unresolved tickets and send them in one message.

Steps to Modify Your Automation:

  1. Use a Scheduled Trigger:
    Set the automation to run every 5 minutes (or your preferred interval).

  2. Lookup Issues Action:
    Replace the branch with "Lookup Issues" and use JQL like:
    assignee = currentUser() AND resolution = Unresolved

  3. Send a Slack Message:
    Use the {{#lookupIssues}} smart value to list unresolved tickets in one message. For example:

    @here Hi team, here is a list of unresolved tickets for {{assignee.displayName}}: {{#lookupIssues}} - <{{url}}|{{key}}>: {{summary}} {{/}}

This will send one Slack message that includes a list of unresolved tickets assigned to the user.
note: lookup issues functionality has limits to perform


SLA Time and Report Add-On for Advanced Tracking

If you need more advanced control over unresolved tickets, you may try SLA Time and Report. It allows you to:

  1. Track Unresolved Tickets: Set up custom SLAs to track how long a ticket has been unresolved and trigger Slack notifications when SLAs are breached or near breached.

  2. Automate Reporting: Use the Report Scheduler to send regular reports of unresolved tickets to email, keeping your team informed.


Setting Up Slack Notifications in SLA Time and Report:

  1. Slack Integration:
    Ensure Slack is integrated with Jira via Jira Settings > Apps > Find New Apps.

  2. Define Your SLA:

    • Create or modify an SLA to track tickets.6f64fd56-9870-4154-8512-8c110a35a7f0.png
    • Set the Start Condition to track when the ticket is assigned or created.
    • Set the Stop Condition to resolve or close the ticket.
    • Define your Goal (e.g., resolve within 24 or 48 hours).
  3. Set Up Slack Notifications:

    • Go to the Limit Exeeded action in the SLA settings.
    • Set the trigger for SLA Time Breach.
    • Configure the Slack webhook and customize the notification message using smart values.ff036fe7-90cf-472f-a0c8-cf5bd2262469.png
  4. Test and Customize:

    • Test your setup by simulating an SLA breach.
    • Optionally, add conditions to send notifications for approaching SLA breaches or set up daily/weekly reports using the Report Scheduler.b31d1959-d341-44b1-a9d7-6860c00bae87.png

For further customization or more sophisticated tracking, SLA Time and Report is a good tool to consider.

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