Hello, we are trying to automate an "on-call" flag for our help desk, We have a custom field that will get changed when a ticket gets created between 5pm-7am Mon-Fri and any time on Sat and Sun. We have the following JQL in place.
(created < startOfDay("+7h") OR created > startOfDay("+17h")) AND (issuetype not in ("Remote Access", "EUS - Equipment Checkout - Take Home")) AND project = EUS AND creator in membersOf("EUS Group")
But we are having trouble adding in the Sat-Sun portion of it. Any help would be appreciated.
Thanks!
1. Saturday/Sunday
According to this documentation
Guess this would go into your first part of the jql with something like
...OR create in(endOfWeek(), startOfWeek())...
2. JQL/conditions (in case of automation rule)
I would suggest to check some conditions (that are easy to check) before the create date as they do not consist of 'OR' relation and the automation rule could immediatly stop processing (and processing throug JQL or date check) in case none of these conditions are met. (as I don´t have same issue types and user groups I just picked some that are available, in case of that automation rule the project doesn´t need to be checked as condition as the rule only exists in the related project and will only be triggered within)
Hope this is what you were looking for. Please let me know if this works.
Best
Stefan
I would probably try something like 'created > endOfWeek("-1d") AND created < endOfWeek("+1d")', refering to https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-endOfWeekendOfWeek--
But I think you have one part which doesn't work as you say it should:
created < startOfDay("+7h") OR created > startOfDay("+17h")
If I do this then it will show me every issue created in the history of the instance, because < startOfDay("+7h") means "anything before that and there is no historical limit, since everything is older than that".
So if I try to refine it in a way I think it should work, then I get to:
project = TEST AND ((created > startOfDay() AND created < startOfDay("+7h") OR created < endOfDay() AND created > startOfDay("+17h")) OR (created > endOfWeek("-1d") AND created < endOfWeek("+1d")))
But even then I would give this some thorough test and trial if it really works the way it should in practice. It seems to do it at least locally but I didn't test issues exactly 00:00 or 00:01 or 06:59 07:01 etc., so you might want to double check if it works on your instance as well.
As long as your automation reacts to issues on-time and on-demand (e.g. listener or automation rule), then this should theoretically work.. as long as there isn't delay.
If this were done with some scheduled job then that might be a problem since we cannot dynamically say "any day between 00:00 and 07:00 and any day between 17:00 and 23:59" right. So as long as this is reactive in time then yeah that might work, I think.
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.