this script allows you to create or update Jira issues from a CSV file. The script reads data from the CSV file and creates or updates Jira issues based on the data provided. The script uses the Jira REST API to interact with Jira. The script supports multi-threading to process multiple issues concurrently.
- Auto define fields type from schema
- Check is field is available in create/edit screen
- Create or update issue
- Handle response status, logging, error handling
- Keyboard interrupt
- Multi-threading
- Test with different field types (array, option, date, user, datetime)
⚠️ URL field can return error with correct value, it's a Jira bug, you can try tro use v2 of the API instead of v3. - Test with large CSV file (80000+ issues created/updated successfully)
- Multi-project and issue type support
Before running the script, make sure you have the following:
-
Python 3 installed on your machine.
-
Required Python packages installed. You can install them by running the following command:
pip install pandas requests tqdm python-dotenv
-
Jira account with API access. Obtain the following information from your Jira account:
- Jira URL
- Jira email
- Jira API token
Before running the script, you need to configure the following environment variables:
JIRA_URL
: The URL of your Jira instance.JIRA_EMAIL
: Your Jira email address.JIRA_API_TOKEN
: Your Jira API token.SCREEN_CREATE
: The screen ID for creating issues in Jira.SCREEN_EDIT
: The screen ID for editing issues in Jira.
-
Place your CSV file named
input.csv
in the same directory as the script. -
Run the script using the following command:
python csv_importer.py
-
The script will read the CSV file and create or update Jira issues based on the data.
ℹ️ csv_to_jira_key_map is a dictionary that maps the column names in the CSV file to the corresponding Jira field names. You can update this dictionary to map the column names in your CSV file to the correct Jira field names. But actually the script use the column names as Jira field names, you can uncomment the csv_to_jira_key_map and use it if you want to map the column names to different Jira field names...
The script logs its progress and any errors to a file named .log
in the same directory as the script.
You can set different logging level (see logging library).