Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Using ScriptRunner, can I search for a specific time on a specific weekday?

Hi there

I know that I can use 

project = ABC AND ((created > startOfWeek("+2d")  AND created < startOfWeek("+7d")))

to look for issues created between Tuesday and Saturday. But what I need is to narrow the range down to issues created between Tuesday 09:00 and Saturday 06:00.

I know JQL can't do it. Can I use ScriptRunner's JQL functions (or a custom function) to do this?

Best regards

 

Sebastian

2 answers

2 accepted

0 votes
Answer accepted
Liam Green Community Leader Dec 29, 2020

Hi @Sebastian Petruschat 

If you work it out in hours then you could use JQL.  E.g. 09:00 Tuesday would be startofWeek("+57h) and 06:00 Saturday would be startofWeek("+174h).

Hope that helps,

Regards, Liam

Hi @Liam Green 

Thanks, this didn't even occur to me even though it is so simple...

Cheers,

Sebastian

Like Liam Green likes this
Liam Green Community Leader Jan 05, 2021

Glad it helped!

Hello @Sebastian Petruschat ,

Yes, with ScriptRunner this can be done.

You can create a function with Scriptrunner that the params will be date and inside the code, set the time that you want. WIth the option "JQL Functions".

Later on, when the Function is developed you can use "IssueFunctionIn" of Scriptrunner in all the JQL that you want to use.

Best regards.

Hi @Juan José Marchal Gómez 

This pointed me in the right direction, even though I used Liam's approach, this  will still be helpful in the future.

Thanks!

Cheers,

Sebastian

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Software

Presenting the "Best of 2020" Jira Software roundup!

Catch up with Atlassian Product Managers in our 2020 Demo Den round-up! From Advanced Roadmaps to Code in Jira to Next-Gen Workflows, check out the videos below to help up-level your work in the new ...

7,193 views 8 28
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you