Hi, in my Service Project I have two teams, one of them manages the issues created during the day time (until 17h CEST) and the other one manages the issues created during the nigh time (from 17h CEST).
I'm trying to automate the assignment process but I'm not being able to find a condition matching my criteria, I tried something like a JQL query as this one:
{{(now.plusHours(7).jiraDate).compareTo(now.plusDays(1).jiraDate)}} = 0
It doesn't work at all, but I'm trying to add 7 hours to now in order to compare it with tomorrow, if now+7 = tomorrow, it means that now is after 17h. I don't know if it is the best way to do it (I guess it is not), but I've not been able to find any doc to help me.
Best regards.
Hi @Manuel Maldonado -- Welcome to the Atlassian Community!
You can also do this with an advanced compare and regular expression check. Please see this post for details:
Best regards,
Bill
Hi @Bill Sheboy, your solution worked great, you just need to take into account that "Created" value in a JQL is always at GTM timezone. This is how it turned out:
Thanks so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am glad to hear that worked!
The way we solve the time zone issue is to adjust it before the condition test, rather than hard-code the altered time values. That prevents issues with time changes for DST and data entry errors.
For example:
{{issue.created.convertToTimeZone(issue.reporter.timeZone).format("hh")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Manuel Maldonado can you send me screenshots of your solution. I did the same but seems only my AM shift is working. @Bill any help would be appreciated.
Use case: the am clock will assign to custom field 1 on an issue type. the pm clock will assign to custom field 2 on an issue type
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @BrentBot_
For something like this, please consider using one rule (not two) and an if/else condition to handle the two cases.
The reason to do this: Your regular expressions overlap. The tests for "1" and "2" in the AM-condition could be found inside of the PM-condition values, and so if the AM rule runs first it will "win". If you perform both in one rule, testing for the PM-condition first, I believe this will work as expected.
Best 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.
Before your if/else clause, please add a write to the audit log for the value you are checking:
{{issue.updated.convertToTimeZone(issue.reporter.timeZone).format("hh")}}
And perhaps also log this value too (please note the format change):
{{issue.updated.convertToTimeZone(issue.reporter.timeZone).format("H")}}
I recall when I last tried this, the automation implementation did not seem to match this documentation, so reviewing different formats could help.
Then run your test again and check the audit log to see what value is there. That may reveal why it is matching on a value that you do not expect.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
welcome to the Atlassian Community!
I believe you can use JQL condition for this, something like:
created >= startOfDay(9h) AND created <= startOfDay(17h)
If issue is created between 9 AM and 5 PM, then ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Hana Kučerová thanks so much for your solution, I I didn't get it to work but I think it was because of the timezone, as my test were done assuming that the dates would be at CEST and they are actually at GTM.
However, I finally took @Bill Sheboy solution and (after noticing it was failing because of the timezone) it worked!
Thanks so much anyway!
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.