Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CLDR-18745
feat: Add interactive Jira ticket fetcher and classifier schema
PR Details
This pull request introduces a new Python script,
jira_classifier.py
, which serves as the foundational component for an automated Jira ticket classification system. The script's primary purpose is to connect to a Jira instance, fetch live ticket data based on user input, and define the comprehensive JSON schema for the final classification output.Implementation Details & Libraries Used
This script leverages several key components to achieve its functionality:
jira
library: This is the core dependency used to interact with the Jira REST API, enabling the script to connect, authenticate, and retrieve ticket information.os
library: Used to securely access environment variables (JIRA_SERVER
,JIRA_USER_EMAIL
,JIRA_API_TOKEN
). This practice prevents sensitive credentials from being hardcoded directly into the source code.json
library: Used for formatting the final classification dictionary into a clean, human-readable JSON string.classification_criteria
) is defined at the top of the script. This acts as a "rulebook" or schema that specifies all possible fields, allowed values, and descriptions for a classified ticket, covering everything fromticket_type
andpriority
toneeds_engineering_work
andis_potential_duplicate
.input()
function to prompt the user to enter a Jira ticket key at runtime. This makes the tool interactive and allows for the analysis of any ticket without modifying the code.Important Note on the Current Output
In this script, we have the same output because of the following reason:
You are getting the same JSON output every time because that part of the script is a hardcoded example. It's a static template meant to show you the goal of the classification, not the actual result.
Your script is currently doing two separate things:
The next phase of this project will be to bridge this gap by implementing a classification engine (either rule-based or using an LLM) to dynamically generate this JSON based on the fetched ticket data.
ALLOW_MANY_COMMITS=true