Forums

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

Percentage between two date-type fields

Hector Eduardo Calzada Tenorio
Contributor
September 26, 2024

 

Hi community, I hope you're doing well.

I would like to know if any of you can help me with a problem that I haven't been able to solve. I need a notification (I'm thinking of using an automation rule) that alerts me when an issue hasn't been updated after 50% of the time between two dates, for example:

Date_Field 1: 26/09/24
Date_Field 2: 01/10/24
Available_Days_Field: 6

 

 

The "Available_Days_Field" will store the difference between the two dates. What I need is to be notified when 50% of these days have passed in relation to the date fields, meaning I need a notification on the 3rd day, which would be 50% of 6 days, so on 29/09/24, I would receive email notification early in the day.

I hope someone can help me with this.

Thank you for taking the time to read my comment.
Best regards.

2 answers

2 accepted

0 votes
Answer accepted
Jakub Koc
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 26, 2024

Hi Hector, 

I think your issue can be solved but it will require playing with some smartvalues,

Things you would have to set up:

- 2 Date fields for date calculation 

- Custom field1 that would hold value of difference between needed date and other custom field2

- Custom field2 that would hold value of original difference between dates

Automation1:
Trigger: Daily at the start of your working day

IF1: If Customfield2 is empty 
- Action: calculate the difference between Datefield1 and datefield2 and put it in customfield2

 {{datefield1.diff(datefield2).abs.days}} 

IF2: IF Customfield2 is not empty 

- Action: calculate value at what date user should be notified: (customfield1) 

{{#=}} {{customfield2}} / 2 {{/}}

and compare this value to 0

IF2.1: IF value calculated in IF 2 will be 0 or less than 0 then send email notification.

 

 

Quick note on that I have tested these as simple automations, haven't really composed them all together so you still might need to check if everything works properly. If you have any questions let me know. Hopefully that will help you:)

 

0 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 26, 2024

Hi @Hector Eduardo Calzada Tenorio 

How are you setting the value of "Available_Days_Field"?

If you already have an automation rule doing that, you likely have used the date / time diff() function to compute the value: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-difference---

That same function could be used with a rule, on a Scheduled Trigger with JQL, finding issues where the date fields are approaching, and then compute the difference with {{now}} to determine your condition.

To get you started on creating your rule, please refer to these documentation and example sources:

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events