Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What is the syntax to count the months between current month and a date in a custom field?

My goal is to have Butler fill custom field {{%Pmts Made} with the difference between {{%First Payment} and the current month. I've tried the syntax 

when custom fields "First Payment" are completed, set custom field "Pmts Made" to "{date=1d}-{{%First Payment}"

but the field doesn't populate.

How can I accomplish this?

1 answer

@William Arn

my understanding is that you can adjust a CF date variable but you can subtract between two CF Date variables. However if you format dates as strings like ~YYYYMMDD you can do arithmetic on them like any other number CF but I does not handle cross month or year. There may be another format that can be used - I have to check. 

@William Arn 

Based on the documentation there appears to be a unix timestamp using ~X. Have not have tried it. If it works you might have to divide by a denominator to cover from secs to say days. Let me know if this work for you. Can learn from you. 

@William Arn 

I tried with ({date=2d~X} - {date=1d~X})/86400 and I set this into a number CF and got 1 which is the expected results to show that indeed you can use the Unix timestamp format to do the maths.

Working with real dates need a bit more investigation

( {{%Date@UTC~X}} - {date=1d@UTC~X} )/86400

print on comment using 

custom field date is {{%Date@UTC}} minus {date=1d@UTC} {time24}

gives you

custom field date is March 1, 2021 12:00 AM +08 minus March 1, 2021 +08 15:40

-0.6531944444444444 when multiply by 24 you get 15.67666 or 15 hrs and 40mins

So {date} it does take on an assumption of time based on current time

Hope this helps.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

3,657 views 25 63
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you