Tried a JQL statement of {{comment.created.longTime.isAfter(6:00:00 PM GMT)}}
However I get audit log errors that tell me nothing more than
'Action details:
Issue condition
The following issues passed: ticket id'
Hi,
I think the problem might lie in your smart value. "longTime" is actually a formatting function so will print the date as a String. Once it's a string it doesn't know how to do an isAfter date comparison. I think just removing that will get you what you need.
{{comment.created.isAfter(6:00:00 PM GMT)}}
Cheers,
Brydie
Hi @bmccoy
Thanks for the response, I will give that a go and let you know if it works.
I was just now having errors with instead trying startOfDay.
Perhaps I am under the wrong impression on how startOfDay works, I looked at the documentation but I didn't see what time startOfDay refers to.
I assume it is the time of 00:00 of the current day, but maybe it instead references the beginning of a work day e.g. 09:00 ?
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.
@bmccoy this is still an issue for us on our side, can you suggest any other methods of checking if the time is before / after a certain hour of the day?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ben Greene
Sorry, I missed your previous messages and apologies for not noticing in your original example. The problem (which looks like you've already realised) is that you need to construct a valid date object for the comparison.
{{now}} is the best way to get a starting date to convert into whatever construct you need.
{{comment.created.isAfter(now.convertToTimeZone("Australia/Sydney").toStartOfDay.withHour(18))}}
I'm also converting to my own timezone so I don't have to figure out what 6pm is in UTC time.
There is an alternative way of doing this which may or may not be nicer for your use case. You can actually inspect the pieces of the created date instead. e.g.
Hope that helps,
Brydie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, as Trudy mentioned, the JQL condition is not the right condition type to be used for this type of query.
Instead, the Advanced compare condition is the one that's designed for these more complex smart value checks.
Cheers,
Brydie
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for sending that over @bmccoy !
I have updated my automation to reflect how you have done it in yours, swapping out the timezone for Europe/London.
I will let you know how it goes when I make a test comment later past 6pm.
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.
Hello @Ben Greene
Please provide all the details of your Rule.
How are you using that JQL statement?
The log is indicating it found an issue that matches your Condition, but you didn't tell us what the condition is.
Are you expecting some action to be taken against the matching issues? What is the action? Is the action not being taken?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply, yes I am expecting a comment to be made on the issue when the timeframe of the reporter's comment is outside the hours I am comparing to:
The comment is not being made and the error just tells me 'issue passed'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Who is the Actor for the Rule? This will be shown on the Rule Details page.
Does that actor have the permissions needed in the project to add comments to the issues.
Can you show the details of the If and Else-If components?
Can you add Log Actions within your If and Else-If branches that will log a message to the audit log? That will tell you which condition specifically has been matched.
Is this the entire rule? Can you show the entire rule?
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.
In the Audit Log you should get an "Issue Conditions" message for each condition that the issue passes.
If the entirety of the Audit Log is
'Action details:
Issue condition
The following issues passed: ticket id'
...then only the first condition (Reporter is not one of) is being met by the triggering issue. The second condition (Created equals a business day) is not being met, so none of the rest of the Rule is being evaluated/executed.
I recreated your rule components, and you can see here that I get two Issue Conditions statements in my log.
So, I know it is getting past those two conditions, but the Status of the rule execution is still "Some Errors". That tells me there is something wrong with the IF component that needs to be investigated.
The Log Action is very helpful to add to your rule to log messages and values into the Audit Log to help you debug the rule. For instance, you may want to add a Log Action immediately after the trigger to log the value of Created so you can see what the rule is comparing to "a business day". And I would recommend you use a Log Action to record the value of {{comment.created.logTime}} so that you can see the value being used in the comparison.
Here I've added that last Log Action I suggested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Didnt know about this log feature, thanks for the tip!
I've added in a couple logs to check the time and if the isAfter works, I will see what it produces when it next fails
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill Had a go logging the longTime
I also tried removing the longTime argument in case that was the issue, but no dice:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried a couple of things.
Based on the documentation, my first theory was that the isAfter function can't be used to compare just times. The documentation shows that it is being used to compare dates. So I tried first printing the full time stamp of the creation of a comment, and then using that text in the comparison for the next run of the run and without the longTime formatting. That still returned the "some errors" status.
Next I tried using just an explicit date in the comparison. That also returned "some errors".
Looking at the example in the documentation, then compared now to another date/time field in the issue.
{{now.isAfter(issue.created)}}
So I tried that. It still returned "some errors" but I also finally got another message in the Audit Log.
IF BLOCK
No subsequent actions were performed since JQL condition did not pass due to error running JQL:
Invalid JQL: true
That leads me to believe that this comparison can't be used in the JQL for the IF block condition.
At this point I don't know what the solution is to get what you want. If I come up with something, I'll post again.
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.