如何获取子任务的父问题类型?寻求隐藏特定子任务的免费JQL方案
Got it, let's tackle this Jira issue where subtasks of Stories/User Stories keep showing up even when you hide those parent issue types in your board. ScriptRunner is great but way too pricey for a single line of code—here are some free, practical alternatives:
1. Native Jira Workaround (No Plugins Needed)
If you want to avoid plugins entirely, you can use a custom field + automation to replicate parent issue type filtering:
- Step 1: Create a custom field
Go to Jira Settings > Issues > Custom fields, add a new field (e.g., "Parent Issue Type" as a single select or text field). Map it to all issue types that include subtasks. - Step 2: Set up automation rules
Navigate to Project Settings > Automation and build two rules:- When a subtask is created, copy the parent issue's type to the subtask's "Parent Issue Type" field.
- When a parent issue's type is updated, sync that change to all its existing subtasks' "Parent Issue Type" field.
- Step 3: Filter with JQL
Now you can use this custom field in your board's filter JQL:
This excludes both the parent Stories/User Stories and their subtasks.issuetype not in (Story, "User Story") AND "Parent Issue Type" not in (Story, "User Story")
2. Free JQL Plugins That Add Parent Issue Filtering
If you'd prefer a plugin-based solution without the cost of ScriptRunner, these free options work well:
- JQL Extensions for Jira (Free Version)
This plugin adds aparentIssueType()function to JQL, letting you directly reference the parent's issue type. Your filter would look like:
The free version supports core functions like this, which is exactly what you need.issuetype not in (Story, "User Story") AND parentIssueType() not in (Story, "User Story") - Advanced JQL Functions (Free Version)
Use thesubtasksOf()function to exclude subtasks of specific parent issues. Your JQL would be:
This filters out any subtask whose parent is a Story or User Story, while keeping other issues intact.issueFunction not in subtasksOf("issuetype in (Story, 'User Story')")
3. Board-Specific Quick Filter Tweak
If you're using a Scrum or Kanban board, you can add a quick filter using the above JQL snippets. Just go to Board Settings > Quick Filters, click "Add filter", paste your JQL, and name it something like "Hide Story Subtasks". You can toggle this filter on/off as needed.
内容的提问来源于stack exchange,提问作者Marks

