Calculating difference between two date custom fields in Trello

Manjula Madineedi April 29, 2021

I am looking if there is a way to calculate the difference between two date custom fields using Butler? Ex: I have 'Start Date' and 'Completion Date' as 2 custom fields and if I want to know the duration of the task, want to write a Butler rule which will calculate the difference of these 2 dates and return in another custom field of 'Task time'. Can someone help?

3 answers

1 vote
richard hoare
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!
February 1, 2024

hey folks, not sure if anyone got any further with this, but i came up with a fix last night after a few attempts.. here's the basic gist..

 

you'll need three custome fields: 1. Start Date (presumably populated earlier on in board); 2. Completion Date (in my case, populated when you move the card to list "Completed"); 3. Days (which is numeric field where the following string comes in. 

 

when a card is added to list "Completed", set date custom field "Completion Date" to now, set custom field "Days" to "({{%Completion Date}~X} - {{%Start Date}~X}) / 86400"

 

what's happening... the Completion Date and Start Date are converted to Unix time code (using "~X") - they're then subtracted from one another which gives an absolute value in seconds. that calculation is then divided by number of seconds in a day (86400) - but the key part to this was placing the initial equation in standard brackets (wrapped around the curly brackets) in order to ensure the subtracted total figure is the figure which is being divided by 86400. 

 

hope this helps someone!

 

thanks!

 

Jake Scott-Hodes March 20, 2024

Super helpful, thank you!

 

0 votes
PROYECTOS DC SPAIN February 9, 2022

I'd like to know the answer as well. I have the same message. Thanks!

0 votes
Vero Rivas
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.
April 29, 2021

Hi @Manjula Madineedi 

   Look at this post, maybe can help you

   https://help.trello.com/article/1159-arithmetic-in-date-variables

Cheers

   

Manjula Madineedi April 29, 2021

Thanks for sharing @Vero Rivas . But that doesn't work for me. Here is the rule I wrote:

when a card is moved into list "Completed", set custom field "* Hours Task Time" to "{{%Completion Date}-{%In Progress Start}}"

When I checked the Command log of the rule, it had this message -- "NaN" is not a valid numeric value.

I am not sure what's wrong in the above rule..

Kelsey Lee April 29, 2021

I'd like to know the answer to this as well. I have the same custom field set up with start date. Trello seems to have updated the calendar to allow start and end dates. That's the only way I've been able to get the timeframe between start and end. 

Like PROYECTOS DC SPAIN likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events