Automated personal email notification based on assigne and expired duedate for each separate assigne

Oleksandr Syvushenko January 29, 2019

Hi, may be some one have the same quest :)

I'd like to figure out how to automate email notification based on JQL "expired due date" (duedate in (now(), -1d, -2d, etc.) for each assigne user in filter.

 

For example, we have a department of 50+ employes, and we need to send daily reminder to each user with a list of his tasks that have duedate = now() or if due date was expired.

 

The list of users and issues are different every day. That's why basic filter email subscription with currentUser() can't help me in this case.

 

I'm already tried:

  1. JQL + Email Subscription: duedate in (now(), -1d, -2d, ..., -19d, -20d) AND status not in (Closed, HOLD) - it's not a solution, because assigners and list of issues are different for each day
  2. Notify each user manualy, but it takes a lot of time to control day by day a list of expired dates issues for each user and send them notifications (via email, messengers etc.)

Are there are any solution in:

  1. Cron for filter subscription? Can i setup it to send a list of needed issues with "duedate = today and duedate = expired" for each assigne?
  2. Some kind of ScriptRunner for automated personal email notification based on assigne and expired duedate for each separate assigne?

 

Thanks a lot!

2 answers

1 accepted

4 votes
Answer accepted
Matthias Jupe (Scandio) January 29, 2019

Hi Oleksandr Syvushenko, 

first welcome to the community.

I think the JQL + Mail Subscription is a good solution. Have your tried this:

assignee = currentUser() AND resolution = Unresolved AND duedate = now()

This shows only issues for the current user who not resolved (what normally means not closed and where the due date is today.

I this helps you.

Greetings,

Matthias

Oleksandr Syvushenko January 29, 2019

Hi Matthias!

What if there are different users and issues for each day?

Do i need to create JQL filter for each user and subscribe each user for this filter?

Matthias Jupe (Scandio) January 29, 2019

Hi,

no you don't need to do this for every user. The currentUser() is a JQL function by the default Atlassian JIRA installation. It takes the current signed in user and put the username in here. So when you are logged in - it show you your assigned issues. For me it show me my own assigned issues.

When you used the share subscription for maybe group, every member received his own filter results. You need the right permissions to create non personal subscriptions.

I hope this helps you.

Greetings,
Matthias

Like Oleksandr Syvushenko likes this
Oleksandr Syvushenko January 29, 2019

Can you please provide JQL example?

My current JQL is: duedate in (now(), -1d, -2d, -3d, -4d, -5d, -6d, -7d, -8d, -9d, -10d, -11d, -12d, -13d, -14d, -15d, -16d, -17d, -18d, -19d, -20d) AND status not in (Closed, HOLD) ORDER BY due ASC

Oleksandr Syvushenko January 30, 2019

It's work! Thanks a lot!

 

assignee = currentUser() AND duedate in (now(), -1d, -2d, -3d, -4d, -5d, -6d, -7d, -8d, -9d, -10d, -11d, -12d, -13d, -14d, -15d, -16d, -17d, -18d, -19d, -20d) AND status not in (Closed, HOLD) ORDER BY due ASC

Matthias Jupe (Scandio) January 30, 2019

Hi,

perfekt!

A small hint. You can short your JQL to

assignee = currentUser() AND duedate <= now() AND duedate >= -20d AND status not in (Closed, HOLD) ORDER BY due ASC

Greetings,
Matthias

Like # people like this
0 votes
José León _Sistel_ January 29, 2019

Hello,

For this kind of things I always prefer to use a script, as you mention. What prevents you from doing that? If you have specific issues, we can help you with that.

Regards

Oleksandr Syvushenko January 29, 2019

I never use script for Jira before, can you show an example and describe the process?

José León _Sistel_ January 29, 2019

OK, now I understand. You can use ScriptRunner or Business Process Studio, whatever works best for you. You will write the script in Groovy, and basically, the process should be the following:

  • Run the JQL
  • Iterate through the issues
  • Send a notification e-mail to the assignee in the issue

For the first two points, you can check here a sample on how to execute a JQL query and iterate it:

https://scriptrunner.adaptavist.com/5.4.47/jira/recipes/misc/running-a-jql-query.html

Like Oleksandr Syvushenko likes this
Oleksandr Syvushenko January 30, 2019

Thanks a lot, but i think currentUser() JQL is what i'm looking for :)

Like José León _Sistel_ likes this

Suggest an answer

Log in or Sign up to answer