Skip to content

feat: Add Jira integration with semantic search - #34

Merged
Chetic merged 4 commits into
mainfrom
feature/jira-integration
Feb 3, 2026
Merged

feat: Add Jira integration with semantic search#34
Chetic merged 4 commits into
mainfrom
feature/jira-integration

Conversation

@Chetic

@Chetic Chetic commented Feb 3, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive Jira integration to ChunkSilo, enabling real-time semantic search of Jira issues alongside local documents and Confluence pages.

Features

Search Capabilities

  • ✅ Real-time JQL-based search at query time (no pre-indexing)
  • ✅ Search issue summaries, descriptions, comments, and custom fields
  • ✅ Configurable project filtering (projects: ["PROJ1", "PROJ2"])
  • ✅ Attachment metadata listing with URIs for access
  • ✅ Semantic/fuzzy search via ChunkSilo's embeddings + FlashRank reranker

Implementation

  • Helper Functions with comprehensive docstrings (400+ lines):
    • _prepare_jira_jql_query() - JQL query construction with stopword filtering
    • _jira_issue_to_text() - Convert issues to searchable text
    • _jira_issue_to_metadata() - Extract structured metadata
  • Main Search - _search_jira() with error handling and timeout protection
  • Pipeline Integration - Integrated into run_search() with ThreadPoolExecutor
  • URI Resolution - Added Jira browse URL formatting

Configuration

jira:
  url: "https://jira.example.com"
  username: "your-email@example.com"
  api_token: "your-api-token"
  timeout: 10.0
  max_results: 30
  projects: []  # Empty = all accessible projects
  include_comments: true
  include_custom_fields: true

Error Handling

  • Graceful degradation if library not installed
  • Timeout protection (default 10s)
  • SSL/TLS certificate support via ssl.ca_bundle_path
  • All errors logged without breaking search pipeline

Testing

  • 50+ comprehensive test cases in test/test_jira_integration.py
  • Mock-based testing (no real Jira connection required)
  • Coverage: JQL queries, conversions, metadata, search, regressions
  • Target: >90% code coverage for Jira integration
  • All Python syntax validated ✓

Design Decisions

Search Strategy (Research-Based)

Based on research of Jira's text search capabilities and JQL best practices:

  • Uses JQL text field for broad search across Summary, Description, Comments, and custom fields
  • Leverages ChunkSilo's semantic search (embeddings + FlashRank) for fuzzy matching
  • Fuzzy operators (~) deprecated in Jira Cloud → rely on semantic reranking instead
  • Supports both Jira Cloud and Data Center/Server

Integration Pattern

Follows existing Confluence integration pattern:

  • Optional dependency: pip install chunksilo[jira]
  • Configuration-driven (disabled by default)
  • Real-time search (not pre-indexed)
  • Threaded with timeout protection
  • Returns NodeWithScore for pipeline integration

Documentation

README.md Updates

  • Installation instructions with Jira support
  • Configuration settings table
  • API token creation guide
  • Troubleshooting section

Code Documentation

  • Comprehensive module-level docstring
  • Detailed function docstrings (Google style)
  • Inline comments explaining WHY, not just WHAT
  • References to Jira API documentation

Files Changed

File Changes
src/chunksilo/cfgload.py Added jira config defaults
src/chunksilo/search.py Added Jira search functions (500+ lines with docs)
pyproject.toml Added jira optional dependency
config.yaml Added example jira configuration
README.md Updated documentation
test/test_jira_integration.py New comprehensive test suite (700+ lines)

Test Plan

Manual Testing

# Install with Jira support
pip install -e .[jira]

# Configure in config.yaml
jira:
  url: "https://jira.example.com"
  username: "your-email@example.com"
  api_token: "your-api-token"

# Search includes Jira automatically
chunksilo search "authentication error"

Automated Testing

# Run Jira integration tests
pip install -e .[test,jira]
pytest test/test_jira_integration.py -v

Verification Checklist

  • Jira results appear in search output
  • URIs link correctly to Jira browse pages
  • Comments and custom fields are searchable
  • Attachments listed in metadata (not indexed)
  • Timeout protection works
  • Graceful fallback when library not installed
  • Project filtering works correctly
  • Date filtering applies to Jira results
  • Recency boosting applies to Jira results
  • All Python files have valid syntax

Breaking Changes

None. This is a new optional feature that:

  • Disabled by default (requires URL configuration)
  • Optional dependency (doesn't affect existing installations)
  • Follows existing patterns (same as Confluence)

Related Issues

Addresses user request to integrate Jira with ChunkSilo for unified documentation search.

References


🤖 Generated with Claude Code

Add comprehensive Jira integration following the existing Confluence pattern.
Enables real-time search of Jira issues alongside local documents with full
semantic search capabilities.

Features:
- Real-time JQL-based search at query time
- Search issue summaries, descriptions, comments, and custom fields
- Configurable project filtering
- Attachment metadata listing (URLs provided for access)
- API token authentication (username + api_token)
- SSL/TLS certificate support for corporate environments
- Timeout protection and graceful error handling

Implementation:
- Added _prepare_jira_jql_query() for JQL query construction
- Added _jira_issue_to_text() for issue text conversion
- Added _jira_issue_to_metadata() for metadata extraction
- Added _search_jira() main search function with comprehensive error handling
- Integrated into run_search() pipeline with ThreadPoolExecutor
- Added Jira URI resolution for browse links

Configuration:
- jira.url: Base Jira URL (empty = disabled)
- jira.username: Jira username/email
- jira.api_token: Jira API token
- jira.projects: Optional project key filtering
- jira.include_comments: Include issue comments
- jira.include_custom_fields: Include custom field values

Testing:
- Added 50+ comprehensive test cases in test/test_jira_integration.py
- Mock-based testing (no real Jira connection required)
- Coverage for JQL queries, conversions, metadata, search, and regressions
- Target: >90% code coverage for Jira integration

Documentation:
- Updated README.md with installation and configuration
- Updated config.yaml with example Jira configuration
- Comprehensive docstrings (400+ lines) with inline comments
- API token creation guide in README

Search Strategy:
- Uses JQL 'text' field for broad search across all text fields
- Leverages ChunkSilo's semantic search (embeddings + reranker)
- Supports both Jira Cloud and Data Center/Server
- Project filtering and custom field search

Based on research:
- Jira text field search capabilities
- JQL operators and optimization best practices
- Elasticsearch fuzzy matching techniques

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 343abb9c28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/chunksilo/search.py Outdated
Comment on lines +612 to +616
if hasattr(issue.fields, 'created') and issue.fields.created:
try:
# Handle timezone indicator 'Z' (UTC)
dt = datetime.fromisoformat(issue.fields.created.replace('Z', '+00:00'))
metadata["creation_date"] = dt.strftime("%Y-%m-%d")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle Jira +0000 timestamps before fromisoformat

Jira REST returns timestamps like 2024-01-15T10:30:00.000+0000, but datetime.fromisoformat() only accepts offsets with a colon (e.g., +00:00). With the current code, those strings raise and the exception path drops creation_date/last_modified_date, so Jira results won’t participate in date filtering or recency boosting (and the new tests using +0000 will fail). Consider normalizing the offset (e.g., insert a colon before parsing) or using datetime.strptime for Jira’s format.

Useful? React with 👍 / 👎.

@claude

claude Bot commented Feb 3, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.


Chetic and others added 3 commits February 3, 2026 10:40
Jira REST API returns timestamps like 2024-01-15T10:30:00.000+0000
(timezone without colon). Created _parse_iso8601_to_date() helper
function that normalizes timezone offsets by inserting colon before
parsing with fromisoformat(). This ensures Jira results properly
include creation_date and last_modified_date in metadata, enabling
date filtering and recency boosting.

Changes:
- Add _parse_iso8601_to_date() helper to normalize ISO 8601 timestamps
- Replace 4 date parsing call sites (Jira + Confluence) with helper
- Add comprehensive unit tests covering timezone format variations
- All 142 tests pass

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Change `include_comments` and `include_custom_fields` from True to False
in the default configuration. This optimizes for the common case where
users want to search by issue summary and description, not dig through
extensive comment threads or custom field metadata.

Users who need comprehensive search can still opt-in by setting these
to true in their config.yaml.

Also update test fixture to match new defaults.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive inline comments to the Jira configuration section
explaining:
- URL format differences (Cloud vs Server)
- Username format (email vs username depending on Jira version)
- API token creation link
- Project filtering examples and performance tips
- Performance implications of include_comments and include_custom_fields

This makes config.yaml self-documenting and reduces the need to
cross-reference the README for basic configuration.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Chetic
Chetic merged commit 4588984 into main Feb 3, 2026
3 checks passed
@Chetic
Chetic deleted the feature/jira-integration branch February 3, 2026 10:51
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