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

Generate programmatically JIRA Worklogs

Dan Apostol
Contributor
January 25, 2023 edited

Need to programmatically execute JIRA Worklogs.
I have the reports saved; I may need to input the date range and report name.

So, each month I need to generate automatically the report that shows the tickets that each and every team member worked on, plus the effort spent.

3 answers

1 vote
Dan Apostol
Contributor
February 5, 2023

We have resolved our needs by automating JIRA Cloud using API 3.
All we needed is just few calls to extract the needed info and then output it to CSV; from then on, it's just XLS file manipulation (import from CSV, formulas, etc); minimal effort required.

On the other hand, it's worth mentioning that JIRA Worklogs extension allows sharing the URL, and if one adds the "export" flag, then from the browser in one shot one could export to XLS a generated JIRA Worklog Report.
However, this solution didn't satisfy our needs: we wanted the whole thing to be automated (i.e. via a cron job), thus no browser, no UI.

Thank you to all who have made suggestions!

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.
January 27, 2023

Hi Dan,

Please check https://bitbucket.org/azhdanov/jiratime/ if it suites your needs, and I can also recommend checking browser extensions, e.g. https://chrome.google.com/webstore/detail/jira-timesheet-for-google/ or https://www.jiraassistant.com/features/reports

Thank you.

0 votes
Adaeze_Jude_HEROCODERS
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.
January 26, 2023

Hello @Dan Apostol 

I would suggest you use a Marketplace App like Clockwork Automated Time tracking and Timesheets.

Clockwork provides you with out-of-the-box reports that allow you to filter by multiple factors including projects, users, issue types, and components.

Once the report is filtered and factors are filtered as you wish, clockwork also allows you to download this report as a CSV file.

Another exciting feature of the timesheet report is the ability to view the overtime and the undertime for each employee. You can filter the report to view employees who have worked for more time and for a lesser time.

Dan Apostol
Contributor
January 26, 2023

That's not going to work for me: I have to stay within the current setup where we use JIRA Worklogs; all I need is how to programmatically execute the Worklogs reports and also generate the CSV output.

I looked at the REST API:
- I went thru Jira 9.6.0 (atlassian.com) and tried to get the list of avlb Worklogs … but it didn’t work: tried “Get worklogs for ids” using https://myjira/rest/api/2/worklog/list

Piotr Stefaniak [HeroCoders]
Contributor
January 26, 2023

Hello Dan,

Piotr here, developer behind Clockwork.

That's not going to work for me: I have to stay within the current setup where we use JIRA Worklogs

Not trying to persuade you, but I think our Clockwork Free could work for you - it operates over JIRA worklogs being stored underneath. You could report time in Jira as usual and only use the reporting functionalities from Clockwork.

BTW: are you using Jira Cloud or Server/DC?

Like DeloresBohns likes this
Dan Apostol
Contributor
January 26, 2023

Hello,
So, what would be Clockwork API that would execute an existing JIRA Worklog Report?

I see in your documentation this example:
https ... /plugins/servlet/ac/clockwork-cloud/clockwork-timesheet#!startingAt=2019-09-23&endingAt=2019-10-24&activeReportDetailKeys%5B%5D=projects&activeReportDetailKeys%5B%5D=users

Well, if I could set there my JIRA Worklog Report name and the date range, then that would be something! assuming I know what the incoming JSON looks like.

Piotr Stefaniak [HeroCoders]
Contributor
January 26, 2023

Can you briefly show me (screenshot?) how your JIRA Worklog Report looks like?

I was imagining that you would probably use Clockwork's "Timesheet" + "Export to Excel" functionalities (manually, on each month), but on the second thought that could be unsuitable for your specific need anyway.

For the record: Clockwork is not integrating directly with JIRA Worklog Reports, but with the underlying worklogs on top of which these Reports are built. So I was thinking that Clockwork could go as reports 1:1 replacement, additionally giving you the ability to query report against selected data range. But... YMMV.

Dan Apostol
Contributor
January 26, 2023

Oh I see; thank you for all the comments/details!

I won't be able to use Clockworks, but on this occasion I learned about it.

Thanks again.

Piotr Stefaniak [HeroCoders]
Contributor
January 27, 2023

Aye. If you would end at building your own solution to retrieve the worklogs via Jira REST API, then maybe this rough sketch will help you out:

It lists the relevant Jira API endpoints and the logic of the script that would be obtaining the list of worklogs for the arbitrary data range. It's unfortunately not connected to your Jira Worklog Report, as there is no API for these reports AFAIK. If you want to programmatically retrieve worklogs from your Jira Cloud, you either have to write your report logic outside of the Jira, or rely on 3rd party tools.

Please ping me if you would anyway achieve the otherwise: export Jira Worklog Reports programmatically in some creative way. I'd be curious to learn about it.

Cheers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Upcoming Jira Events