Forums

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

Need to run fortnightly report

Johnny_Lau May 9, 2019

Need help with JQL expression to run scheduled fortnightly report.

 

For example:

End of Week 2 (Jan) - Run Report from 1 January to 15 January

End of Week 4 (Jan) - Run Report from 16 Jan to 31 Jan 

And So On.

 

Currenty, the scheduled report is run quarterly and it has more than 1000 lines so the rest are not captured/reported.

Current JQL expression below:

project = "BOS" AND issuetype = "XXX Request" AND created >= 2019-01-01 AND created <= 2019-03-31 

1 answer

1 accepted

0 votes
Answer accepted
Sreenivasaraju P
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2019

project = jira and created > startOfMonth() - you can use this for 15th report. This is will give all the issue created in this month.

project = jira and created > startOfMonth(2w) - you can use this for month end report. This will give all issues created after 2 weeks in this month.

Johnny_Lau May 9, 2019

The Cron job/schedule as to when it will run has no issue. But the content of the report of which it needs to pull the created issue is what I am struggling. 

 

Every time the Cron job is run, it will not pull the report content of which it has previously run.

Sreenivasaraju P
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2019

Sorry. You can use below jqls.

project = jira and created > startOfMonth() - you can use this for 15th report. This is will give all the issue created in this month.

project = jira and created > startOfMonth(2w) - you can use this for month end report. This will give all issues created after 2 weeks in this month.

Johnny_Lau May 9, 2019

Thanks Sreeni.

With created > startOfMonth(), can you explain how it will capture 1st to 15th (inclusive)?

And how with created > startOfMonth(2w), will it capture 16th to end of month? If I schedule it to run fortnightly with Cron job?

Sreenivasaraju P
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 9, 2019

Hi @Johnny_Lau ,

As we are not mentioning any end date( like created <), it will give you the list of created requests till date. If you configure your cron 15th, it will upto 15th. If you configure on 16th it will give till 16th.

 

startOfMonth(2w) will give you requests created after 2nd week to till date. If you can use days also like > startOfMonth(7d) , > startOfMonth(15d) ..etc. In this case of end date will be till date. 

If needed you can give end date also like created < startOfMonth(7d)

project = jiraproject and created > startOfMonth() and created < startOfMonth(16d)

Johnny_Lau May 9, 2019

Thank you. That explains well.

Johnny_Lau May 9, 2019

Just for reference:

1st Fortnightly Report

CRON: 0 0 00 16 * ?

project = "XXX" AND issuetype = "XXX" AND created > startOfMonth() AND created < startOfMonth(16d)

 

2nd Fortnightly report:

CRON: 0 0 00 L * ?

project = "XXX" AND issuetype = "XXX" AND created > startOfMonth("+14d") AND created > startOfDay() 

Suggest an answer

Log in or Sign up to answer