Here’s a complete solution that addresses all your traceability concerns without requiring expensive marketplace apps:
Workflow Validators Enforcing Links:
Use Script Runner’s “Simple Scripted Validator” on your bug workflow’s “In Progress” transition. Add this Groovy script:
issue.getIssueLinks().any { it.issueLinkType.name == "Relates" }
This blocks the transition unless at least one “relates to” link exists. For native Jira DC without plugins, you can’t enforce link validation-you’ll need to rely on automation rules for soft enforcement instead.
Standardized Issue Link Types:
Create a dedicated issue link type called “Defect-Requirement” (inward: “is defect for”, outward: “has defect”). This makes traceability queries explicit and prevents confusion with generic “relates to” links used for other purposes. Update your automation rules and JQL queries to use this specific link type.
Automation Rules for Unlinked Defects:
Create a scheduled automation rule (daily at 9 AM):
- Trigger: Scheduled (cron: 0 9 * * *)
- Condition: JQL query `project = DEV AND type = Bug AND status NOT IN (Closed, Done) AND issueFunction NOT IN linkedIssuesOf(“project = REQ”)
- Action: Add comment tagging assignee: “@{{assignee}} This defect has no requirement link. Please link to the related Story or Task.”
- Action: Add label “unlinked-defect” for tracking
This creates visibility without blocking work.
Mixed Requirements Issue Types in One Project:
Standardize your linking policy: Defects should link to the lowest-level requirement (Task if it exists, otherwise Story, otherwise Epic). Then create an automation rule to propagate traceability up the hierarchy:
- Trigger: Issue linked (link type = “Defect-Requirement”)
- Condition: Linked issue is a Task or Story
- Action: If linked to Task, also create link to parent Story; if linked to Story, also create link to parent Epic
This automation ensures defects appear in traceability views at all hierarchy levels, even if the user only links to the Task.
Traceability from Requirement to Defect:
For native Jira DC dashboards without marketplace apps, create a custom JQL gadget for each requirement level:
- Epic Traceability: `issueFunction in linkedIssuesOfRecursive(“project = REQ AND type = Epic AND key = EPIC-123”, “Defect-Requirement”) AND type = Bug
- Story Traceability:
issue in linkedIssues(STORY-456, "Defect-Requirement") AND type = Bug The linkedIssuesOfRecursive()` function (available via Script Runner or Advanced Roadmaps) traverses parent-child links and issue links together, giving you full Epic-to-defect visibility.
Complete Implementation Plan:
- Create custom “Defect-Requirement” link type to standardize traceability
- Add Script Runner validator to bug workflow (if available) or rely on automation soft enforcement
- Deploy daily automation rule to flag and notify about unlinked defects
- Deploy link propagation automation to ensure defects appear at all hierarchy levels
- Update dashboard gadgets to use
linkedIssuesOfRecursive() or install a free traceability plugin like “Issue Matrix” for hierarchy views
- Document linking policy: “Always link bugs to the most specific requirement (Task > Story > Epic)”
This approach ensures your mixed-issue-type requirements hierarchy maintains accurate defect traceability for compliance audits, without requiring expensive marketplace apps or custom development. The automation rules provide both enforcement (via notifications) and convenience (via link propagation), while standardized link types make reporting reliable.