JQL Query

Clayton
Contributor
June 10, 2024

Hey Everyone

I’m trying to create a JQL to find issues created before the last two weeks of the current month.

Doing some studying I see this is the answer:
created < startOfMonth(-2w)

This confuses me :( I am interpreting the question to be issues created before last two weeks of current month so for example we are June. So it’s asking for issues created still in June but before the last two weeks. I. e 1 June till 15 June. Is that correct?

If so, will the proposed query not give final two weeks of May results as its starts of month (June) less 2 weeks?

Thanks for any help

3 answers

3 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2024

Hi Clayton,

My interpretation of the question is that you are right about the time period and the answer you listed doesn’t give issues in that time period. It should use endOfMonth and not startOfMonth.

Clayton
Contributor
June 11, 2024

Thanks John :)

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2024

You are welcome!

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2024

Hello @Clayton 

Welcome to the Atlassian community.

You are partially correct.

If the current month is any date in June then the query will return everything created before May 17 - the start of the current month minus two weeks.

If you want the issues created before the last two weeks of the current month then you need to use 

created < endOfMonth(-2w)

If you want to limit that also to only issues created in the current month, excluding everything created in previous months then you would use

created < endOfMonth(-2w) and created > startOfMonth()

Clayton
Contributor
June 10, 2024

@Trudy Claspill thanks for that! It’s strange as that is the question and the answer from Atlassian training content. I therefore felt that maybe I was interpreting that question incorrectly :)

I read the question that if we are in June its essentially asking for issues created in first two weeks of June (Issues before the last two week in June which would be last two weeks :) )

Would you agree with that?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2024

@Clayton 

I can't attempt to interpret the question without the complete text of the question and any available context around the question.

Is it a question presented with multiple choices from which the answer must be selected?

What is the source of the question (link to the training material)?

Like Clayton likes this
Clayton
Contributor
June 11, 2024

@Trudy Claspill for some reason I cant post the question here as it says I have already asked something similar :)

Its all good I do understand your answers though and did some tests.

Thanks for the welcome :)

Are questions we post to a specific group also visible to the rest of the community or will people only in that group see them?

Thanks!
Clayton

0 votes
Answer accepted
Mark Higgins
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2024

Hi Clayton,

You may need to add one more clauses, to get the actial period you require.

create < startofmonth(-2w) (if we are in June) = created before startofmonth(-2w), which is designed to give you all the tickets created before the 2 weeks before the start of month.

If you want the final two weeks of the previous month, you can create:

 

created >= startofmonth(-2w) and created < startofmonth()

Hope I have that right.

Mark

 

Mark Higgins
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 10, 2024

I should have refreshed the page :-) 

Like Clayton likes this
Clayton
Contributor
June 10, 2024

Cheers  @Mark Higgins

I read the question that if we are in June its essentially asking for issues created in first two weeks of June (Issues before the last two week in June which would be last two weeks :) )

Do you agree?

TAGS
AUG Leaders

Atlassian Community Events