I have an automation set up to run once a week which emails the reporter when the expiry date on a ticket is within the next 7 days. However, when it runs it is notifying users about tickets where the expiry date is more than 7 days in the future. What am I doing wrong? I thought I might be using > instead of < but when I looked at switching that around it looked like this might result in emailing users where the expiry date is in the past. The numberOfDaysBeforeDueInclusion variable is set to 7.
Hey @Kara Nadarajah,
While there are already good answers regarding a suitable JQL, allow me the question, why you want to use an automation rule instead of (the admittedly often overlooked) filter subscriptions?
In your scenario, you'd have to include something like
reporter = currentUser()
in your query and subscribe a user group to this filter running at your preferred schedule. No automation limit consumption etc.
Thanks, there is another section not in the screenshot which deals with who gets emailed. I am not sure what you mean about filter subscriptions, I have never used them and don't know how they work. IIRC I set this up using a template and then amended it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Forgot the link in my first response, sorry for this: https://support.atlassian.com/jira-software-cloud/docs/manage-filters/#Subscribe-to-a-filter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>= endOfDay(7) will indeed return dates more than 7 days from now.
What you need is this:
<= endOfDay(7): everything with a date less than 7 days from now. But this will include items in the past.
So combine with "Expiry date[Date]" >= now() to get future items only.
Result:
"Expiry date[Date]" >= now() and "Expiry date[Date]" <= endOfDay(7)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is an easy way to do this.
I see use the field "Expiry date" to look at.
In your lookup use the clause:
"Expiry date" = "{{now.plusDays(7).jiraDate}}"
Then branch over {{lookupIssues}} and sent a mail in the branch.
This will find all work items with an Expiry date set 7 days from now and for each wotk item sent an email
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a good solution using smart values!
But the trigger of the rule is once a week. If you want to do an exact date match like that you should run the rule every day. So pay attention to that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct.
Then you could set
"Expiry date" >= "{{now().jiraDate}}" and "Expiry date" <= "{{now.plusDays(7).jiraDate}}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.