Skip to content

Conversation

preetsojitra2712
Copy link
Contributor

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.
  • Comprehensive Classification Schema: A detailed Python dictionary (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 from ticket_type and priority to needs_engineering_work and is_potential_duplicate.
  • Interactive User Input: The script uses the built-in 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:

  1. It successfully fetches the real, live data from the Jira ticket you specify.
  2. It then prints a fixed, unchanging example of what a classified ticket's JSON should look like.

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.

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

preetsojitra2712 added a commit to preetsojitra2712/cldr that referenced this pull request Aug 6, 2025
@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

@preetsojitra2712
Copy link
Contributor Author

Hello @younies please Review this PR

@younies younies self-requested a review August 7, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant