This Python script allows you to retrieve completed issues from Jira associated with a specific user and organizes them into a Lucid document based on quarterly categorization. This script can be used to view completed work by an individual in a calendar year. Also, each shape representing a Jira issue has a link back to the source issue on Jira.
- Python 3.x installed on your system
Before running the script, ensure you have the following Python modules installed:
dotenv
: Usepip
to install thedotenv
packagerequests
: Usepip
to installrequests
package
pip install python-dotenv
pip install requests
- Ensure you have appropriate access to the Jira instance.
- Provide the necessary authentication details (email, domain, and API token) in the
.env
file. You should be able to see your current Jira API tokens here.
- Obtain API credentials (OAuth 2.0 token) from the Lucid Developer Console.
- Put your valid OAuth 2.0 token in the
.env
file to authenticate and access Lucid. - Note: The API credential is the generated OAuth 2.0 token that is valid for 1 hour from generation. You will need to generate a new token each time you use this script.
- Execute the Python script jira_to_lucid_doc.py.
- Provide the Jira email (doesn't have to be the same as the auth email), year for which you want to fetch issues, and Lucid product you want to import the document into (
lucidchart
orlucidspark
).
- The script will connect to Jira using the provided credentials and fetch all issues associated with the specified user.
- It categorizes these issues by the quarter they were updated or created.
- It creates a Lucid document with separate containers for each quarter, organizing the issues within them.
- Access the generated Lucid document through the generated link to visualize the categorized issues based on quarters.
- Use the Lucid interface to further analyze and manage these issues conveniently.
This script requires specific environment variables to be set in a .env
file within the project directory. Create a .env file with the following variables:
- Generate an API token or key from your Jira account settings. This token will be used as the
JIRA_API_KEY
.
- Use the email address associated with your Jira account as the
JIRA_AUTH_EMAIL
.
- Obtain an OAuth 2.0 token by creating an OAuth 2.0 app in your Lucid Developer Console. Use the generated token as
LUCID_OAUTH2_TOKEN
.
- Identify and specify the subdomain of your Jira instance's URL. For instance, if your Jira URL is
https://yourcompany.atlassian.net
, the subdomain isyourcompany
. Use the subdomain asJIRA_SUBDOMAIN
.
JIRA_API_KEY="your_jira_api_key"
JIRA_AUTH_EMAIL="your_email@example.com"
LUCID_OAUTH2_TOKEN="your_lucid_oauth2_token"
JIRA_SUBDOMAIN="your_jira_subdomain"
The script includes the following flags:
-
- When this flag is set, two files will be created to assist in debugging. One will be a .csv file of the issues sorted by quarter, and the other will be a raw dump of all the JSON issues received from Jira.
-
- Display the help message explaining how to use the script and its flags.
python jira_to_lucid_doc.py
- Ensure proper permissions and access levels for Jira and Lucid accounts to avoid authentication or data access issues.
- Ensure the .env file remains secure and isn't shared or committed to version control systems as it contains sensitive information.