How to pass startDate and endDate in URL

Tony L May 5, 2022

When i run a report in JIRA, i can put the start and end dates in the parameters in its configuration but then, when i run the same report the next day i have to enter the start and end date again.

I want to do a shortcut in my web browser using the URL generated by the JIRA report but i would then need to have a automatic start and endate like startOfWeek () and endOfWeek () parameters in the URL instead of having fixed start and end dates.

Now, what i tried is :

https://jira.it.volvo.net/secure/TimesheetReport.jspa?reportKey=jira-timesheet-plugin%3Areport&selectedProjectId=14750&reportingDay=0&startDate%3E=startOfWeek(+1d)&endDate%3C=startOfWeek(+6d)&targetUser=ub60220&projectRoleId=&projectid=14750&filterid=&priority=&commentfirstword=&sum=day&groupByField=customfield_13010&collapseFieldGroups=true&sortBy=&sortDir=ASC&Next=Next

 

but what i get is not the right date range which from April29th to May 5th and today we are May 5th.

 

Maybe something is wrong in my syntax.

 

Thanks

Tony

 

1 answer

0 votes
Andriy Zhdanov
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 5, 2022
Tony L May 5, 2022

Hello Andriy,

I looked and the 'reportingDay' doesn't help me get ...

...show time spent for the current week, up to next Monday.

It always goes back to last week.

What i want to achieve is to see the current week, from Monday to Friday no matter what day i run the report.

Thanks

Tony

Andriy Zhdanov
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 5, 2022

Hm, looks like you should not pass any dates or reportingDay, it is supposed to show current week by default.

Tony L May 5, 2022

No, if i remove all this, it gives me last Friday to today which is not the current week summary.

Andriy Zhdanov
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 5, 2022

please try adding offset=1, i.e. reportingDay=1&offset=1

Tony L May 5, 2022

Sorry, not changing

Tony L May 5, 2022

So, today to get this week's times, i have to push this in my URL ...

&reportingDay=0&startDate=2022-05-01&endDate=2022-05-07

 

instead of entering the start and end dates everytime, I was expecting to enter something like ...

&reportingDay=0&startDate=startOfWeek()&endDate=EndOfWeek()

 

so when i would use my shortcut in my browser, i would always get the current week times.

but it doesn't work. 

It's like the system doesn't recognize the startOfWeek() or EndOfWeek() statments and it then puts last week Friday up to today which is not the current week.

Andriy Zhdanov
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 5, 2022

Sorry, it appears numOfWeeks=1 is needed to make it work, and reportingDay=2 for Monday, e.g.

http://localhost:2990/jira/secure/TimesheetReport.jspa?reportKey=jira-timesheet-plugin%3Areport&weekends=true&reportingDay=2&numOfWeeks=1Screenshot 2022-05-06 at 8.21.18.png

 

And if you need next week, add offset=1, it works when there is numOfWeeks param.

Actually, I've got it from gadget, as described in the doc, I've sent initially.

Note, the easiest way to compose correct report url is to click Details link in corresponding gadget, when it shows variable time window you'd like to get in the report.

Tony L May 6, 2022

Thanks, it works !  

I tried to find this 'Details' link but couldn't find it.

Suggest an answer

Log in or Sign up to answer