Updated Problem Statement:
Need help on the syntax for the computing date difference between current time (now) and a pre-set datetime (Need By Date).
Variable: Need By Date (DateTime)
Simplified Trigger. Trigger is working and runs a query every five minutes. Objective is to compute the test hours remaining in every issue.
1. {{now.diff("Need By Date").hours}}
No Errors on the automation but returns a null result.
2. {{(now).diff("Need By Date").hours}}
Error on execution.
3. {{"Need By Date".diff(now).hours}}
Working but negative results.
4. {{"Need By Date".diff(now).hours.multiply(-1)}}
Works perfectly fine.
I need to put an extra process on my computation just to get the desired result.
My question is what would be the correct syntax if i reverse my variables (1 and 2) instead of the (3,4) approach.
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
For your second case, you have parentheses around the now smart value. Please try to remove those and re-test.
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.
Thanks for that information, Ray.
There are known problems having now first in a diff() expression, although there does not seem to be consistency of the symptoms (according to community posts). Additionally, there is a known problem where it diff() does not work accurately inside of an iterator / loop.
You note "Need By Date" is a variable date / time. Do you mean it is a created variable in the rule or that it is a custom field of type date / time?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's a custom field of type date / time?
Option 4 is working for me. I just don't understand that why i can't do that in reverse.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What type of project is this: company-managed or team-managed? You may find that information at the lower-left of the page expanding area.
And if this is team-managed, did you add this custom field yourself to the project?
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.