Forums

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

JIRA Automation - Send email when issue is blocked with duration in Blocked Status

Devender Singh June 1, 2023

Hi All,

I am trying to create a JIRA Automation that will send email when an issue is Blocked with time in Blocked Status. I am able to send emails, however unable to find a way to calculate the time it was in Blocked status.

2 answers

1 accepted

1 vote
Answer accepted
Mark Segall
Community Champion
June 1, 2023

Hi @Devender Singh - Unfortunately, you cannot natively track time in status with automation via a smart value.  You could do this instead:

  1. Create a custom date field to track time in status
  2. Use automation to populate this field when the issue transitions to a new status

Automation would look something like this (I'm using a fictitious field called Transition Date in my example):

  • TRIGGER: Issue Transitioned
  • ACTION: Edit Issue (Transition Date)
    • {{now}}

For your email rule, it would look something like this:

  • TRIGGER: Scheduled 
    • status = Blocked
  • ACTION: Send Email
    • {{issue.key}} - {{issue.summary}} has been BLOCKED for {{issue.Transition Date.diff(now).businessDays}} business days.

Note - This is calculating business days, but you could substitute with any of the options described in this documentation:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/

Devender Singh October 11, 2023

Thank you Mark.. Appreciate you help.

Like Mark Segall likes this
0 votes
Emre Toptancı _OBSS_
Atlassian Partner
June 2, 2023

Hello @Devender Singh ,

You can do this by simple filter subscriptions.

Go to Jira's issue search screen. Search with a JQL query like below:

project = ABC and status = Blocked and not status changed FROM Blocked AFTER -3d and assignee = currentUser()

The query is pretty self-explanatory. This will filter the issues "in the ABC project" that are "currently in Blocked status", "was not moved away from Blocked status in the last 3 days" (because an issue might be unblocked and blocked again), and "is assigned to the current user". (You can modify the query according to your specific needs)

Save this as a "JQL Filter". Then go to the "Details" menu of the filter. There, you can create a subscription for yourself or (if you have the necessary Jira permissions) a subscription for others.

A subscription will send the issues that match the JQL as an e-mail with predefined intervals.

(If you create a subscription for a group of users, please note that this query will run for all those users for each cycle. This might cause a significant load on your server if you have thousands of users. So use this with caution.)

EmreT

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events