Happy to share the full implementation details that address all three focus areas:
For REST API integration, we used the Atlassian Jira REST Java Client library rather than building from scratch. This handles connection management, authentication, and API versioning automatically. Authentication uses API tokens stored in Windchill’s secure property vault:
// Pseudocode - REST API Integration:
- Initialize Jira client with base URL and API token from vault
- Configure connection pool (max 10 concurrent connections)
- Implement retry logic with exponential backoff for API failures
- Use async API calls to avoid blocking test execution
- Log all API interactions for audit trail
// Reference: Jira REST API v3 documentation
For automated defect creation, we implemented a custom event listener that subscribes to test case state changes in the quality-mgmt module. When a test execution transitions to ‘Failed’ state, the listener triggers:
// Pseudocode - Automated Defect Creation:
- Extract test case details (ID, name, expected/actual results)
- Capture failure context (error message, stack trace, timestamp)
- Query Jira API for existing defects matching test case ID
- If duplicate found: add comment with new failure occurrence
- If new defect: create Jira issue with custom fields populated
- Store Jira issue key as soft attribute on Windchill test case
- Create bidirectional link between objects
// See implementation: CustomTestFailureListener.java
The duplicate detection uses JQL queries to search for open defects. We generate a failure signature hash based on test case ID and error type, which allows us to group related failures even if the exact error message varies slightly.
For traceability improvement, we implemented bidirectional synchronization. The Windchill side maintains a soft attribute storing the linked Jira issue key. The Jira side includes a custom field with the Windchill test case URL. We built a scheduled job that runs every 4 hours to sync status updates:
// Pseudocode - Bidirectional Sync:
- Query Windchill for test cases with linked Jira defects
- Batch fetch Jira issue statuses via REST API
- Update Windchill test case attributes if Jira status changed
- Handle edge cases: deleted issues, closed-reopened defects
- Send notification to test owners on status changes
// Scheduled task runs via Windchill cron expression
When test cases are retired, our lifecycle template includes a gate that checks for open linked defects. If any exist, the retirement is blocked until defects are resolved or the link is manually removed with justification. This ensures we don’t lose track of unresolved issues.
The performance impact was minimal - the event listener processes asynchronously, so test execution isn’t delayed. The Jira API calls typically complete in under 2 seconds. For high-volume test runs, we implemented batching where multiple failures are queued and processed together to reduce API calls.
Quantified benefits after 6 months:
- Manual defect creation time reduced from 5-10 minutes per failure to zero
- Defect creation accuracy improved from ~85% to 99% (fewer missing fields or incorrect links)
- Average cycle time from test failure to defect assignment decreased by 40%
- Traceability between test execution and defect resolution improved from 60% to 95%
Key lessons learned: Invest time in robust error handling for the API integration - network issues and API rate limits will occur. Implement comprehensive logging so you can diagnose issues when automation fails. Most importantly, involve both QA and development teams in defining the defect creation template so the auto-generated tickets contain the information developers actually need.
The code is modular enough that you could adapt it for other issue tracking systems by swapping the Jira client library. The core pattern of event-driven integration with bidirectional synchronization works well for any external system integration with Windchill.