JQL Date and Hours - jira

I am taking my first steps in Jira automations and I had the following query:
Can I define actions to be executed at a specific time of a day of the week?
I have created the following rule, which I would like for example to be executed on Saturdays. Is it possible to define range of hours and dates?
Thank you very much![enter image description here][1]
JQL: updated >= startOfDay(8h) AND updated <= startOfDay(11h)

Related

Match date in two cells with conditional formatting, +/- 3 days.. Google sheets

I am making a deadline sheet for office.
I have made a conditional format that compares the dates with our "office are closed"-dates provided by our HR-department. If the delivery date match any of the "office closed"-dates in the next column it will be coloured red.
This works fine, but I just noticed one thing. If the date where 1 day before the holidays, and the holidays would be many days a row starting next day, we wouldn't see that and we would probably get big trouble manage Finnish these masters before deadline as we are not at office for a few days.
So, I thought, maybe I could add to the script something that says: "compare the dates in this column with the dates in "Office Closed"-column, if there is a match within a range of 5 days, color it red...?
Is this something I can do?
here is a screenshot of the sheet.
This is the code I use in Conditional Formatting now:
=COUNTIF($L$4:$L$25,H6)>0 which works fine.
Thanks for any help!
/Andreas
Use following formula in CF:
=IF(LEN(A2),SUMPRODUCT((($C$2:$C+3)>=A2)*(($C$2:$C-3)<=A2)))

Jira filter to list ticket created between a time period of day

How to create a JQL filter to list all tickets created between 8 AM to 4 PM irrespective of created day and date?
I know startOfDay() deal with only for current day. For example , below will list all ticket created of 'myproject' between 8 AM and 4 PM of current day (as per timezone set in my user profile)
created > startOfDay("+8h") and created < startOfDay("+16h") and projecy='myproject'
My requirement is list a ticket created any day (not only current day) in my work shift 8 AM to 4 PM.
Your requirement can not be fulfilled with simple JQL queries. You could query the database directly with some SQL or you can use some scripting with a plugin (check out this post for example).
Other possibilities are to use the JIRA API to receive the ticket data and then filter the tickets which were created in the desired time frame.
Another possibility to at least get the relevant tickets from the current week with a JQL query could be to create a filter like this: created > startOfWeek(7h) AND created <= startOfWeek(17h) OR created > startOfWeek(31h) AND created <= startOfWeek(41h)... (Source)

Set start and end date to current month Google Anaytics API

I'm setting up Google Sheet report using the Google Analytics app to generate a custom report, I've spent days searching for info on the subject all over the web for an answer to set current month for the report.
I can set start and end date with no problem, but I want the automated reports to be able to reset to the current month without me having to update the start and end date every month.
To achieve this, use the below:
For End Date, use
today
or, to make your report upto the previous day:
yesterday
For the start date, use the formula below:
=CONCATENATE(YEAR(today()),"-",
IF(LEN(MONTH(TODAY()))=1,CONCATENATE(0,MONTH(TODAY())),MONTH(TODAY())),
"-01" )
The formula will concatenate the current year, current month, and 01.
Another way to approach this problem is through using EOMONTH, for example to get the first day of this month:
=EOMONTH(today(), -1)+1

Find JIRA tickets created between 9.00 am and 10.00 am

Assuming I have hours per day set at 8 and start time set at 9.00 am how can I narrow down tickets using a JQL filter for tickets created between 9.00 am and 10.00 am? I was thinking something like:
AND updated > startOfDay() AND updated < startOfDay("+1h")
Please see my answer here: Filter issues updated by particular user in period of time using JQL
It seems like you are asking the same question. Hopefully this helps you out.
A scripted field using Script Runner plugin will show the hour:
import java.util.Calendar
Calendar cal = Calendar.getInstance()
cal.setTime(issue.created)
cal.get(Calendar.HOUR_OF_DAY).toString()

How do I query Jira to search for all issues that have been resolved within a length of time from when it was created?

For example, let's say I need to find all issues that were resolved within 1 week's time. I need something like:
resolved - created < '1w'
Another example:
Let's say I have 3 issues:
1) created 2 days ago, resolved 1 day ago.
2) created 5 days ago, resolved 4 days ago.
3) created 3 days ago, resolved 1 day ago.
I need a query that will return 1 and 2, but not 3. I need to query for issues that are created at some day X, and resolved <= day X+1.
You have all sorts of control with queries. For example, here is how I check for my tickets that are on hold that I have not updated in the last 5 days.
currentUser() AND status = "On Hold" AND updated <= -5d
Created in the last 5 days would be:
created >= -5d
Resolved in the last 7 days would be:
resolved >= -7d
OR
resolved >= -1w
I don't know if it matters yet but I resolved it with dateCompare():
issueFunction in dateCompare("", "created > resolved -5d"))
So since this does not seemed to be built into JIRA by default my only other suggestion is to see if you can extend JQL to add it.
How's your Java? See how to add JQL to JIRA
So, you want to see all issues where (Resolved date-Create Date) < 1 day
Or 2 days, or 3 days. I think I'd create a (hidden) calculated custom field that shows Resolved-Created and use an Exact Number Searcher on it. Or maybe write a custom JQL function to do the same thing. No way to do it in standard JIRA.
This finds all issues, that were resolved the same day they were created, within the specified period:
project = MyProject AND created >= 2021-11-29 AND created < 2021-12-05 AND issueFunction in expression("", "created.clearTime()==resolutionDate.clearTime()") ORDER BY created DESC, updated DESC
Where this part
created >= 2021-11-29 AND created < 2021-12-05
is any period you're looking for issues within and
issueFunction in expression("", "created.clearTime()==resolutionDate.clearTime()")
is the condition that converts the Date-Time format of "created" and "resolutionDate" to only Date-format and compares the received dates with each other.
The topic's task:
If you add +1 to created.clearTime() - created.clearTime()+1, you will find all issues that were resolved the day they were created and issues that were resolved the next day (+1 day from the creation date).
Note, that you need to use a plugin (I'm using ScriptRunner).

Resources