Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Need ticket data using JSOn for particular time frame every day

Dhananjay Kumar
Contributor
August 1, 2022

Hi Team,

Please help me with the query to get the Ticket data every day from 6AM to 3PM.  I understand that for the daily data, I can use: 

created >= startOfDay(0) AND created <= endOfDay(0)

For particular time of given day, I use: 

created >= '2022-05-02 22:00' AND created <= '2022-05-03 8:00'

 

Is there any option or Query to fetch data every day for given time frame without putting the date.  

Thanks in advance

Dhananjay

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
August 1, 2022

You can add relative hour adjustments to the startOfDay and endOfDay functions:

created >= startOfDay(6h) AND created <= endOfDay(-6h)

Without modifiers startOfDay is assuming 00:00 of today and endOfDay is assuming 23:59.

Using the modifiers I added above it would look for issues created later than 6 hours from the start of today (i.e. 06:00) and less than 6 hours before the end of today (i.e. 17:59)

Dhananjay Kumar
Contributor
August 1, 2022

Thank you very much @Trudy Claspill . It works as per my requirement.  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events