This project automates the process of logging work hours from a CSV file into JIRA. It reads time entries from a CSV file exported from the Toggl Track extension, calculates the total duration for each ticket, and logs the hours in JIRA using the JIRA REST API.
Before you begin, ensure you have met the following requirements:
- You have installed Python 3.6+.
- You have a JIRA account with API access.
- You have the required permissions to log work in JIRA.
-
Clone the repository:
git clone https://github.com/nachochiappe/jira-worklog-automation.git cd jira-worklog-automation
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.env
file in the root directory of the project. - Add the following variables to the
.env
file:USERNAME=[email protected] API_TOKEN=your_api_token SUBDOMAIN=your_jira_subdomain
- Create a
-
Activate the virtual environment:
source venv/bin/activate
-
Run the script:
python log_hours_to_jira.py <start_date> <end_date>
Replace
<start_date>
and<end_date>
with the desired date range inYYYY-MM-DD
format.
To log hours from June 1, 2024, to June 30, 2024:
python log_hours_to_jira.py 2024-06-01 2024-06-30