Hi Automation folks I have created the following automation rule, and cannot seem to get it to work. I am thinking it has to do with the formatting of the form date but unsure. I've tried a lot of different variations, but have not been able to get it to work. I would love others thoughts on what may be going wrong here.
Below, I have included the rule and the audit log. In the rule, I am accessing a date field in a JSM form using the UUID. I am then comparing that date field to today.
My two variables:
Created variables are text (regardless of the source type). And so when the condition comparisons are done on text, that uses alphanumeric comparison.
If you want to compare them as dates, first use toDate to convert them, and then use appropriate date / time functions or conditions:
Kind regards,
Bill
wow... i did not know that, clearly. I guess all this time my variables have been text.
Thanks Bill, I will give that a go.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI for a workaround when preserving the data typing is desired (for Jira Cloud rules)...
Rather than using Create Variable, use Create Lookup Table as the team got it to preserve the typing and structure of the source.
For example, this is helpful in situations where one wants things like multiple Lookup Issues results:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
good tip.
I did get this automation working and took a slightly different approach which your answer clued me in on. I decided to use the following
/ Gets the number of days between two dates
{{now.diff(issue.created).days}}
which looked like this...
{{now.diff(issue.forms.ce0ce3fc-5a3b-4e86-85f5-0eeee44094b1.last.eap-enddate).days}}
and then used that to compare to 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jack Brickey ,
Have you tried date compare? In your case it would be {{fred.compareTo.(endDate)}}. If the returned value is 0 then the two dates are the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mikael Sandberg , I had not. I am trying it now but the syntax isn't quite right. In your suggestion fred and endDate are smartvalues.
I get ...
unable to render smart values...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got the following syntax to pass but it still does not compare as I would expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok so indeed it has to do with the date. I tested if {{fred}} is less than {{endDate}} and it succeeded. So I just need to recall how to ignore the time component I think as that is not important in my compare.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jack Brickey , could you use {{fred}}==
{{now.format("dd/MM/yyyy")}}
instead of {{fred}}== {{now().jiraDate}} to leave out the time?
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.
No immediate luck. I have some other ideas that I'm going to try, but need to move onto some other things at the moment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.