I am trying to create a report of items that have exceeded an approved testing days field. To do that I am comparing the difference between 2 dates and then comparing with another field. I have tried many different iterations of the {{#if }} but I can't see to get the if statement to run in any scenario, can someone let me know if this is possible and what syntax changes I need to make it work?
My code is below:
Also you closure statement is not correct, it is just {{/}}, not {{/lookupIssues}} and the closure before contains a space, see {{ /}}
Thank you for your reply but unfortunately I have tried many variations. If I simplify the content of the email to the below, it still doesn't go into either the if or else blocks, and no errors are thrown either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is no Else option.
I can't seem to grasp your logic.
{{#if(gt(Planned start.diff(Planned end).days, customfield_11661.asNumber))}} is the field 11661 already populated?
This as a the date diff gives a valuer back in days already.
gt function can only be used after and in a calculation not with dates.
What if you do (as test)
First make sure field 11661 is set based on date diff.
Then lookup the issues with this field set.
{{#lookupIssues}}
{{#if(customfield_11661.gt(2))}}
{{key}}
{{/}}
{{/]}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I managed to get it to work thank you. It was a simple syntax issue, this is what resolved the problem for me.
{{#if(Planned start.diff(Planned end).days.gt(customfield_11661))}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI -- Although there is no {{else}} in smart value syntax / functions, there is a variant of the if() function which supports true or false results:
{{if(smartValue, "value if true", "value if false")}}
Please note well:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.