Here’s the complete solution we implemented for cross-project test-to-defect synchronization:
Understanding the Cross-Project Limitation: Jira’s subtask architecture requires parent and child to be in the same project. You cannot create subtasks in PROJECT-QA with a parent issue in PROJECT-DEV. This is a fundamental constraint of Jira’s data model, not a configuration issue.
Issue Type Mapping Strategy: Create corresponding issue types in PROJECT-QA that mirror your PROJECT-DEV subtask types (Error Log, Screenshot, Environment Detail, etc.). Alternatively, use a generic “Diagnostic” issue type with a custom field “Original Type” to preserve the semantic meaning. The automation rule maps between these during sync:
{
"project": "PROJECT-QA",
"issuetype": "Diagnostic",
"customfield_10050": {{issue.issueType.name}},
"summary": "[{{issue.issueType.name}}] {{issue.summary}}"
}
Parent-Child Relationship Preservation: Instead of trying to recreate subtasks, create regular issues in PROJECT-QA and link them to the test execution using a custom link type called “has diagnostic” or “documents”. The automation rule triggers when subtasks are created under defects in PROJECT-DEV:
Trigger: Issue Created
Condition: Issue Type = Subtask AND Parent Issue Type = Bug
Action: Create Linked Issue (in PROJECT-QA, linked to related test execution)
Custom Field Mappings for Test Metadata: Copy critical fields from the DEV subtask to the QA diagnostic issue. Key fields to map:
- Description and attachments (screenshots, logs)
- Test execution ID or key (to find the correct parent)
- Timestamp and environment details
- Severity or priority if applicable
Use the “Edit Issue” action after creation to copy these fields. Attachments require a separate action or script to transfer.
Validation Strategy with Sample Defects: Test the sync with representative scenarios:
- Create a defect with 3 subtasks (screenshot, error log, environment) in PROJECT-DEV
- Verify 3 diagnostic issues appear in PROJECT-QA linked to the test execution
- Confirm attachments and custom fields transferred correctly
- Check that updates to DEV subtasks trigger updates to QA diagnostics (if bidirectional sync needed)
For bidirectional sync, add a second automation rule that triggers on subtask updates and propagates changes to the linked QA diagnostic issue. Use smart values to prevent infinite loops: {{issue.changelog.items.first.toString}} to check if the update came from automation.
Alternative Architecture: If preserving the exact hierarchy is critical, consider consolidating into a single project or using Jira’s project linking features to display cross-project hierarchies in reports and dashboards. Some teams use Structure or other hierarchy apps to visualize relationships across project boundaries without actual subtask creation.