Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

Worklog Extractor

A worklog extractor in Jira is a tool that allows you to extract worklog data from Jira and store it in a desired format. This can be useful for tracking employee productivity, analyzing team performance, or generating reports for clients.

We have created worklog extractor for one of our client Experian

We have written a Python script that extracts the worklog data into a csv file.

Attached is the Python script that runs the worklog extraction job.

Features we have in Experian

The features of the Worklog Extractor in Experian include:

  1. Filter by Projects: For every projects in Jira(whichever we have mentioned projectKeyScopeList in config file), it will check for the issues to extract worklogs from.

  2. Filter by Date Range: Users can select a specific date range in config file to extract worklogs within.

  3. Output Format: The Worklog Extractor allows users to select the output format for the extracted worklogs, such as CSV or XML(Issue,Project,Issue Type,Business Value,epicLink,Initiative,Work Categories,Worklog Day,Worklog Reporter,Worklog Reporter ID,TimeSpent).

  4. Time Tracking: The Worklog Extractor includes time tracking information such as total time spent in a particular Jira issue.

  5. Email: At last it will send an email which contain csv report of worklog extraction.

So, similar to Experian, we also planned to create a marketplace cloud app by taking reference from Experian features.

In this documentation, we will guide you through the process of creating a worklog extractor in Jira using Python.

Prerequisites

Before you can create a worklog extractor in Jira, you will need the following:

  • A Jira account with the necessary permissions to access worklog data.

  • Python 3.x installed on your computer.

  • The requests library for Python, which can be installed using pip.

Steps to Create a Worklog Extractor in Jira

Follow the steps below to create a worklog extractor in Jira:

  1. Connect to the Jira API using the requests library in Python. You can do this by sending a GET request to the Jira API endpoint.

  2. Authenticate with Jira using your user credentials or an API token. This will allow you to access the worklog data.

  3. Retrieve a list of issues with worklogs from Jira using a JQL search. This can be done by sending a GET request to the Jira API endpoint with the appropriate parameters.

  4. Loop through each issue and retrieve its worklogs using the Jira API. This can be done by sending a GET request to the Jira API endpoint for each issue.

  5. Parse the worklog data and store it in a desired format. For example, you could store the data in a CSV file or a database.

  6. End the extraction process.

Extra features we can add:

  1. Filter by User: Users can select a specific user or a set of users to extract worklogs from.

Below are some similar marketplace apps available:

Worklogs - Time Tracking and Reports : https://empyrajira.atlassian.net/jira/marketplace/discover/app/com.soldevelo.apps.worklogs

Team Worklog Reports: https://empyrajira.atlassian.net/jira/marketplace/discover/app/com.gebsun.atlassian.reports

Worklogs Report: https://empyrajira.atlassian.net/jira/marketplace/discover/app/biz.epicreport.worklogs

Timela - Worklog and Timesheet: https://empyrajira.atlassian.net/jira/marketplace/discover/app/jp.dssolution.jira.timela

Basic App We can and are going to create a worklog extractor by analyzing the other apps in the Jira marketplace:

You can access Worklogs - Time Tracking and Reports via Jira’s top menu, under Apps

Like how we have a similar app called Timela and Worklogs.

The worklog report will be presented in the form of a table.

Projects: You can use this projects dropdown to display particular Jira projects. You can add as many as you need. Worklogs will be displayed for issues that match at least one of the selected projects.

User: The “User” filter allows you to set Worklogs to display time logged by specific users.

Date Range: You can select a specific date range to display your work logs from a specific time period. You can also use one of the suggestions (today, current week, current month, or custom) by clicking on it.

Export: We can download the worklog report by clicking on the export button.

Note: Reference screenshots taken from the similar app called “Timela“.

Conclusion

By following the steps outlined in this documentation, you can create a worklog extractor in Jira using Python. This will allow you to extract worklog data from Jira and store it in a desired format for further analysis or reporting.

Note:

If we try to extract a one-year worklog from Jira, it may take a long time, depending on the number of worklogs and the complexity of your Jira instance. Jira has a default limit for the number of results it returns in a single query, so we may need to make multiple queries to retrieve all the worklog data we need. Another way we can use the REST API to extract worklog data.

  • No labels