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

I cannot get a simple substraction between Custom Fields value to work Edited

Hello 

I need a field to be populated with the number of month to go till the end of the year.

His number will be based on a custom Start Date. In a separate question Ludo has helps me parsing the Month number from a Custom Start Date Field. 

Now I have this "Month Number" parsed I want to do :  

"# Months to go" = "13" minus "Month Number"

I don't understand why the following syntax does not work : 

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month})"

All custom fields below  are number (except date) 

"YTD +1" being set to "13"

"Probable Start date" being set to "April, 15, 2020" 

"Prob Month" is correctly evaluated as "4"

but "YTG Impact" is incorrectly set to "13" when I expect 13 - 4 = "9"

I have also tried : 

set custom field "YTG Impact" to "13 - {{%Prob Month})"

same result the set always consider only the first term of the operation 

  

2 answers

2 accepted

0 votes
Answer accepted

Hi

There is probably a syntax error.

Try this :

{{%FY}+1 - {%Prob Month}}

or {13 - {%Prob Month}}

or 13-({{%Prob Month}})

or ({{%FY}} - {{%Prob Month}})+1

Thank you for the attempt. Unfortunately none of the above gives the expected result. Have you ever seen the arithmetic on Number  Custom Field Variables  working?  

Not tested. But visibly it is possible. See this :

https://help.trello.com/article/1161-custom-field-arithmetic

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

@Xavier Lecomte 

I just have tested this rules, and it works for me

when custom field "Date" is set, set custom field "n1" to "{{%Date}~MM}", and set custom field "n2" to "{{%n1}}+3"
when custom field "Date" is set, set custom field "n1" to "{{%Date}~MM}", and set custom field "n3" to "{{%n1}}+{{%n2}}+3"

 

Hey Ludo 

Thank you 

Below my syntax and that does not work : 

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "13-{{%Prob Month}}"

 

I think I will go to the support but wanted to thank you 

0 votes
Answer accepted
Iain Dooley Community Leader Feb 25, 2020

@Xavier Lecomte this works for me:

when custom field "Start Date" is set to a date, set custom field "Prob Month" to "{{%Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month}}"

I think your only problem is that you have included a close parenthesis instead of a closing curly brace, that is this:

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month})" <---- note the parenthesis here

should be this:

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "{{%FY+1}} - {{%Prob Month}}" <---- note the curly brace here rather than the close parenthesis

Hey Iain

Thank you 

Below my syntax and that does not work : 

when custom field "Probable Start Date" is set to a date, set custom field "PROB MONTH" to "{{%Probable Start Date}~MM}", and set custom field "YTG Impact" to "13-{{%Prob Month}}"

 

I think I will go to the support but wanted to thank you 

Suggest an answer

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

Develop a new Habit during Lockdown

If you had to thrive a new habit during a lockdown, what would it be? Trello

1,550 views 13 5
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