Forums

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

Jira Reminder Notification

RedRock
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2023

Hello everyone, 

Here's basically the behavior I'm trying to set up in Jira:

I have 2 custom fields: a date picker and a number field. If the date subtracted from the number equals the current day, then send me a notification.

I started looking at automation. But I'm stuck on creating a filter that could do this subtraction and check if the result equal to the current date.

I thought of creating a third field that would do this subtraction with a script, but here again after several attempts I'm getting nowhere.

Could you help me find a filter (JQL) or a script (groovy) that gives me this result? If Date - Number = today's date, show me the corresponding tickets

Thank you in advance for any help or advice you could give me.

 

1 answer

0 votes
Ste Wright
Community Champion
July 30, 2023

Hi @RedRock 

I tried to do this in one rule, but it would not work - so I used two. This is what I did:

  • Added an additional custom date picker - eg. Date Check
  • Created rule 1, which sets "Date Check"
  • Created rule 2, which checks if "Date Check" equals today, then takes action if it is

---

Rule 1 - Set Date Check

For this rule, I've used an IF/ELSE to set the date, so it becomes NULL if either field is blank.

  • Trigger: Field Value Changed
    • Fields to Monitor = Date Field, Number Field - i.e your 2 original fields
  • Condition: IF Block
    • IF...
      • All Conditions Match...
        • Condition: Issue Fields Condition
          • Field = Date Field
          • Condition = is not empty
        • Condition: Issue Fields Condition
          • Field = Number Field
          • Condition = is not empty
      • Action: Edit Issue
        • Field = Date Check
          • Value = {{issue.Date Field.minusDays(issue.Number Field)}}
    • ELSE...
      • Condition: Issue Fields Condition
        • Field = Date Check
        • Condition = is not empty
      • Action: Edit Issue
        • Field = Date Check
          • Value = NULL - leave empty

---

Rule 2 - Date Comparison

Now we have Date Check populated, we can schedule a rule to check if it equals today, and take action if it does.

  • Trigger: Scheduled
    • Run rule every = 1 days
    • Run a JQL Search = TRUE
      • JQL - "Date Check" >= startOfDay() and "Date Check" <= endOfDay()
    • Only include issues that have changed since = FALSE
  • Action: Send Email
    • Details here (To, Subject, etc)

Note: You could use smart values to set dynamic detail in the "Send Email" fields.

---

Let us know if this works for you.

As a side-note, I did test all this in Jira Cloud, but I believe it should all still work in Server/Data Center.

Ste

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events