I'm trying to write a report to show issues that were reported after 5pm on the issue creation date. For testing, I am trying 10am to ensure a data set.
I have a series that is based on Created, and the JQL filter looks like this:
created >= startOfDay("+10h")
The report only shows issues that were created TODAY after 10am.
JQL is so strange and poorly documented that I can't figure out the correct syntax for this. There is no way that I can find to extract the time component and compare it, and various solutions online use this startOfDay() method, but it appears to use TODAY as the startOfDay() instead of the start of day of the issue's creation date.
(Anyone want to fight me on JQL being strange can explain to me why "labels = Task" translates to "labels contains Task" and yet JQL has a contains operator that is not compatible with the labels field.)
Thanks.
P.S.: I can do this through brute force and a python script, but I'd rather not. For instance, this query works for the month of July:
created < "2024-07-01 07:00" OR (created > "2024-07-01 21:30" AND created < "2024-07-02 07:00") OR (created > "2024-07-02 21:30" AND created < "2024-07-03 07:00") OR (created > "2024-07-03 21:30" AND created < "2024-07-04 07:00") OR (created > "2024-07-04 21:30" AND created < "2024-07-05 07:00") OR (created > "2024-07-05 21:30" AND created < "2024-07-07 07:00") OR (created > "2024-07-06 21:30" AND created < "2024-07-08 07:00") OR (created > "2024-07-07 21:30" AND created < "2024-07-08 07:00") OR (created > "2024-07-08 21:30" AND created < "2024-07-09 07:00") OR (created > "2024-07-09 21:30" AND created < "2024-07-10 07:00") OR (created > "2024-07-10 21:30" AND created < "2024-07-11 07:00") OR (created > "2024-07-11 21:30" AND created < "2024-07-12 07:00") OR (created > "2024-07-12 21:30" AND created < "2024-07-14 07:00") OR (created > "2024-07-13 21:30" AND created < "2024-07-15 07:00") OR (created > "2024-07-14 21:30" AND created < "2024-07-15 07:00") OR (created > "2024-07-15 21:30" AND created < "2024-07-16 07:00") OR (created > "2024-07-16 21:30" AND created < "2024-07-17 07:00") OR (created > "2024-07-17 21:30" AND created < "2024-07-18 07:00") OR (created > "2024-07-18 21:30" AND created < "2024-07-19 07:00") OR (created > "2024-07-19 21:30" AND created < "2024-07-21 07:00") OR (created > "2024-07-20 21:30" AND created < "2024-07-22 07:00") OR (created > "2024-07-21 21:30" AND created < "2024-07-22 07:00") OR (created > "2024-07-22 21:30" AND created < "2024-07-23 07:00") OR (created > "2024-07-23 21:30" AND created < "2024-07-24 07:00") OR (created > "2024-07-24 21:30" AND created < "2024-07-25 07:00") OR (created > "2024-07-25 21:30" AND created < "2024-07-26 07:00") OR (created > "2024-07-26 21:30" AND created < "2024-07-28 07:00") OR (created > "2024-07-27 21:30" AND created < "2024-07-29 07:00") OR (created > "2024-07-28 21:30" AND created < "2024-07-29 07:00") OR (created > "2024-07-29 21:30" AND created < "2024-07-30 07:00") OR (created > "2024-07-30 21:30" AND created < "2024-07-31 07:00") OR (created > "2024-07-31 21:30" AND created < "2024-08-01 07:00") |
Hello @Michael Church
startOfDay(+8h) after 5pm today
This may be a good place to start.
JQL for After Hours and Weekends
Consider the working time configured in the server
search-jira-like-a-boss-with-jql
Basic searching
Quick searching
Advanced searching
Advanced searching - fields reference
Advanced searching - keywords reference
Advanced searching - operators reference
Advanced searching - functions reference
Search syntax for text fields
Saving your search as a filter
Working with search results
I don't think you understand.
I'm writing a report.
When I use startOfDay(+offset), the rule only matches tickets from TODAY. So the line is 0 all month, and only matching tickets from TODAY appear. I would have to reconstruct the query from my postscript to use startOfDay instead of absolute values which doesn't do anything but make the window shift day-by-day.
I read that issue already, and it does not address the question. I have also read all of the JQL docs.
Thanks anyway.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the right place to as developer related questions would be Atlassian's developer community if you are writing a plugin.
const startDay = 1; // Monday
const endDay = 5; // Friday
const startHour = 8; // 8:00 AM
const endHour = 17; // 5:00 PM
const isInsideBusinessHours = (date = new Date()) => {
const day = date.getDay();
const hour = date.getHours();
return day >= startDay && day <= endDay &&
hour >= startHour && hour < endHour;
};
One could also use the search from the REST API and use JQL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not writing a plugin. I'm using JSM's built-in reports.
Thanks.
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.