feat: Add Jira integration with semantic search - #34
Conversation
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>
There was a problem hiding this comment.
💡 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".
| 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") |
There was a problem hiding this comment.
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 👍 / 👎.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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>
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
projects: ["PROJ1", "PROJ2"])Implementation
_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_search_jira()with error handling and timeout protectionrun_search()with ThreadPoolExecutorConfiguration
Error Handling
ssl.ca_bundle_pathTesting
test/test_jira_integration.pyDesign Decisions
Search Strategy (Research-Based)
Based on research of Jira's text search capabilities and JQL best practices:
textfield for broad search across Summary, Description, Comments, and custom fieldsIntegration Pattern
Follows existing Confluence integration pattern:
pip install chunksilo[jira]NodeWithScorefor pipeline integrationDocumentation
README.md Updates
Code Documentation
Files Changed
src/chunksilo/cfgload.pysrc/chunksilo/search.pypyproject.tomlconfig.yamlREADME.mdtest/test_jira_integration.pyTest Plan
Manual Testing
Automated Testing
# Run Jira integration tests pip install -e .[test,jira] pytest test/test_jira_integration.py -vVerification Checklist
Breaking Changes
None. This is a new optional feature that:
Related Issues
Addresses user request to integrate Jira with ChunkSilo for unified documentation search.
References
🤖 Generated with Claude Code