Forums

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

I would like to compare the number of days of two fields

Vincent Roireau-Minville
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!
August 6, 2021

Hi,

I'm currently trying to compare the number of days between two custom-field and a hardcoded number of days.

The two custom fields are "Leaving date" and "Coming back date". By using the smart value : {{issue."Leaving date".diff(issue."Proforma : Coming back date")}}, it will return the numbers of days between these two dates using the format : "n days" (ex: 7 days).

However, I'm unable to compare the returned value (ex: 7 days) with a hardcoded one which would be 30 days as you can see in the picture below.

I also tried to put "30 days" and "30d" in the second value, but I can't seem to make it work.

P.S. We would like to implement this rule, because if an employee takes a leave of more than 30 days, we're legally obligated to block his access to our system.

Thank you,

Vincent

JIRAAA.png

2 answers

1 accepted

1 vote
Answer accepted
Alex Koxaras -Relational-
Community Champion
August 7, 2021

Hi @Vincent Roireau-Minville and welcome!

Try using absolute value on the end of your smart value:

{{issue."Leaving date".diff(issue."Proforma : Coming back date").days.abs}}

 

date.png

 

Let me know if everything worked from your end :)

 

Alex

Vincent Roireau-Minville
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!
August 9, 2021

Wow Alex, it works like a charm!

Thanks a lot for the help!

Vincent

Like # people like this
Alex Koxaras -Relational-
Community Champion
August 9, 2021

Nice to know it worked, and glad to help! :)

0 votes
Peter Preston
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.
August 8, 2021

Hi @Vincent Roireau-Minville - ProForma does not currently support calculating fields, but you can find instructions for creating calculating fields here:

This may not be exactly what you’re looking for, but hope it helps and if you have any additional questions about how to make this work please let me know.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events