Issues not refreshing as wanted
Asked by Daniels_Breiers:

project = SD AND issuetype = "Table Incident" AND "Table Incident Category" in cascadeOption(11205, 13602) AND "What happened with Card Games?" = "Extra card came out of the shoe" AND "Date of Event UTC" \>= startOfDay("+5h") AND reporter in (membersOf(SMmalta))

So I have this advanced search setup. It is good, but not perfect as I want.

The problem is that I want for these issues to Reset every 24 hours at time set by me, but at the same time to show issues for exact date. For example I want to see issues that happened on 1st June, but in the way that this search shows them from June 1st 7:00 AM CET till June 2nd 6:59 AM CET. And at 2nd June 7:00 AM CET it resets and starts showing issues of 2nd June.

I tried to change argument in line StartOfDay(X), but it seems that it doesn't work and it always resets at 1:00 AM CET. When I try to use other functions it resets at the same time.

What could be the issue?


Answers:
author: Diego
body: Hello [@Daniels_Breiers](/t5/user/viewprofilepage/user-id/3933612) ! The behavior you are experiencing is by design of the function you used. The startOfDay() function will look for the start of the current day, so it will always change after 24h.

We can look at our documentation about this function here:
> * ++***[\[Jira Software Support\] Advanced search reference -- JQL functions](https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearching-functionsreference-startOfDay)***++

The way the query was set up, it will look for all issues created in the current day 5 hours after the start of said day.

If you need to *remove* the results from the day after, we need to add another condition to your Query. I would look like this:

```
project = SD AND issuetype = "Table Incident" AND "Table Incident Category" in cascadeOption(11205, 13602) AND "What happened with Card Games?" = "Extra card came out of the shoe" AND "Date of Event UTC" >= startOfDay("+5h") AND "Date of Event UTC" <= endOfDay AND reporter in (membersOf(SMmalta))
```

What I added is this:

```
AND "Date of Event UTC" <= endOfDay
```

We use the Less Than Equals operator and the endOfDay() function:
> * ++***[\[Jira Software Cloud\] Advanced search reference -- JQL functions](https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearching-functionsreference-endOfDay)***++
> * [++***\[Jira Software Cloud\] Advanced search reference -- JQL operators -- Less than equals***++](https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-operators/#Advancedsearching-operatorsreference-LESS_THAN_EQUALS%3C=LESSTHANEQUALS:%3C=)

However, since the startOfDay always resets at the start of the current day, this will not display issues from the previous day.

What I do not fully understand, is "I want for these issues to Reset every 24 hours at time set by me, but at the same time to show issues for exact date".
> 1. *What was meant by "reset these issues"?*
> 2. *What is the "exact date" that needs to be displayed?*

As I see it, you need to keep displaying issues from yesterday up until a specified time of the current day. Would that a correct interpretation of your needs?

Let me hear from you!

comments: author: Daniels_Breiers
body: Good morning,

I need to keep displaying issues that happened on Current day (12AM-11:59PM), but in the way that they are showing from Current day 7:00 AM until next day 6:59 AM.


Tags: cloud