Rules
Rules build part of a tree from Jira data and keep it current. A hierarchy can mix rows placed by rules with rows you placed by hand.
On this page
How rules work
A rule is a row of the tree and applies where it sits: a rule at the top level works on the whole hierarchy, and a rule under a row works only on what sits under that row. Rules run in the order they are listed, so an "add" rule comes before the rules that extend, filter, group or sort what it added. Rule rows always show at the top of their level, before the rows they add. A rule dragged among other rows goes to the end of that level's rules, and a rule can't be placed inside what the rules added.
The app builds rule results in the background and refreshes them when work items change in Jira. When a new work item matches a rule, or a work item moves in Jira, it shows up in its place shortly after. Everyone who opens the hierarchy sees only the work items Jira lets them see.
To change rules, you need Automate access to the hierarchy. Your Jira admin can also limit who may change rules across the whole site in Automation permissions.
The Rules panel
Open Panels on the hierarchy's title line and choose Rules. Add > Rule in the toolbar opens the panel on a new rule's form, for people who may change rules. Each rule's chip in the tree opens it too. When the hierarchy has rules, the menu shows their count, such as Rules (3).
The panel lists the rules in order, each with Edit and Remove. At the top, a line says whether results are up to date or still updating, and Refresh results builds them again on request.
To add a rule, select Add rule, pick the Rule type and fill in its fields. New rules go at the top level. To put one under a row instead, focus that row first and tick Apply under "…" only. Rules can't go inside the results of other rules.
The list of rule types groups them by what they do: Add work items, Add under each work item, Keep only, and Group and sort. Under the list, a line says what the type picked does, such as "Puts each work item's children under it: an epic's stories, then their sub-tasks, as many levels as you choose."
When your rules add work items from JQL, a board or a text search, and no rule puts work items under them or groups them, the panel says the tree is a flat list: "Your rules add work items as a flat list. To put each one's children under it, such as an epic's stories and their sub-tasks:". Add child work items, beside it, opens the form of a new rule of that type. A hierarchy brought in with Add another hierarchy has its own tree, so it doesn't count as a flat list.
Rule rows show in the tree like other rows. To leave them out of your view while you work, turn on Hide rules in the toolbar. See Hiding rule rows.
On sites with Rovo, people with Automate also get Build with Rovo at the top of the panel. It opens Rovo chat on the TreeCraft hierarchy helper agent, ready for you to describe what the hierarchy should hold. The agent suggests rules, explains them, and adds them once you agree, with the same checks as rules you add here. See Building rules with Rovo.
JQL suggestions
Every JQL box in the app suggests what can come next where you type: fields, the operators of the field before, its values, the functions that fit, AND, OR, ORDER BY, and ASC or DESC. The boxes are those of the Add work items from JQL and Keep work items matching JQL rules, Add work items, Narrow with JQL in New hierarchy, the JQL query of a Matches a query… column, the JQL mode of Find, and the Keep work items matching JQL transform. The Search work items box of query mode offers none, because it also takes plain text.

- Fields whose names hold the words you typed come first when their names start with them. A field goes in by its name, in quotes when it needs them, or as
cf[10020]when two fields share a name. Values go in quoted when they need it. - The list opens as you type, or with Ctrl+Space. ↑ and ↓ move through it, Enter puts a suggestion in and offers what comes next, Escape closes the list without closing the dialog, and Tab leaves the box. A query you paste opens no list, so nothing covers the buttons.
- Nothing is ever picked for you: the text stays as you typed it. When Jira's lists can't be read, the box works as a plain text box and says why under it.
Once you pause typing, Jira checks the query, and what it finds wrong shows under the box, as "Jira can't read this JQL: …". Suggestions and checks are read from Jira with your own rights, so they offer only the fields and values Jira lets you use.
On sites with Rovo, the rule form of Add work items from JQL and Keep work items matching JQL also has Ask Rovo under the JQL box, as does the Matches a query… column dialog. It opens Rovo chat with the query typed, for help writing or fixing it, and leaves the box and its suggestions as they are. See Formulas and queries with Rovo.
Rule types
Adding work items
| Rule | What it adds | Options |
|---|---|---|
| Add work items from JQL | The work items a JQL query finds. | Maximum work items, up to the site's limit. |
| Add work items from a board | A board's work items. | Work items: all of the board, in active and future sprints, in the backlog, or the epics. A Kanban board has no sprints or backlog. |
| Add work items found by text | Work items with these words in any text field (summary, description, comments), as Jira's search finds them. | Words, Maximum work items. |
| Add another hierarchy | Another hierarchy's work items, arranged as they are there. Its folders are left out. | Only people who may open that hierarchy see its work items. A hierarchy can't contain itself. See Hierarchies that add other hierarchies. |
A query that depends on who runs it, such as one with currentUser() or recently viewed work items, is worked out for each person when they open the hierarchy. This is slower, and the form warns you about it.
Bringing in related work items
| Rule | What it adds | Options |
|---|---|---|
| Add child work items | The children of each work item: subtasks, the work items of each epic, and children at every level of Jira's parent field. | Levels: how many levels down. |
| Add linked work items | The work items linked to each work item by one link type. | Link type, Direction (outward, inward or both), Levels. |
Example: a release's epics, with their stories under them. You want the epics of release 1.0 in the PLAN project, and under each epic its stories and subtasks.
- Open Panels and choose Rules. Select Add rule.
- Pick Add work items from JQL and type
project = PLAN AND issuetype = Epic AND fixVersion = "1.0". Select Save.- Select Add rule again, pick Add child work items and set Levels to 2. Select Save.
You see the two rule rows at the top of the tree. Below them are the epics, such as PLAN-1 "Mobile app launch", with their stories under them (PLAN-2, PLAN-3) and the subtasks under the stories (PLAN-5). The second rule extends what the first one added, because rules run in the order they are listed. With Levels set to 1, you would see the stories but not their subtasks.
Filtering, grouping and sorting
| Rule | What it does | Options |
|---|---|---|
| Keep work items matching JQL | Keeps only the work items that match the query. | Keep parents of matching work items. |
| Keep work items containing text | Keeps only the work items that contain the text. | Keep parents of matching work items. |
| Group by field | Puts work items under a row for each value of a field, such as project, fix version, assignee, status, sprint, component, label, a custom field option, a service desk request type or an Assets object. Request types group by their name. | Same names together, for example versions with the same name in several projects. |
| Group by linked work item | Puts each work item under the first work item it is linked to by a link type. Each group is named by that work item's key. | Link type, Direction. |
| Sort by field | Sorts the work items by any field, or by board rank. | Descending. |
Rules filter by JQL and by text only. Other filters, such as by field value, sprint or tree query, are transforms, which change only your own view. To sort or group by a column such as a formula or a total, use that column's header menu.
Example: show only the work that is still open. The tree above is long, and you only care about work that is not done.
- Select Add rule, pick Keep work items matching JQL and type
statusCategory != Done.- Tick Keep parents of matching work items. Select Save.
You see only the open stories and subtasks, each under its epic. An epic stays even when it is done, because it is the parent of work that matches. Without the tick, an epic that does not match is left out, and everything under it goes with it.
Example: one group for each owner. The top level of the tree holds epics, and you want to see them by person.
- Select Add rule and pick Group by field.
- For Field, pick Assignee. Select Save.
You see one group row for each assignee, named after the person, with that person's epics under it. The stories stay under their epics. Put this rule after the rules that add work items, because a rule works on what the rules before it added.
Limits and notices
The site's admins set how large rule results may grow: rows in one hierarchy, work items one rule may add, the deepest level rules may fill, and how many levels one "add children" or "add links" rule may add. A hierarchy holds at most 20,000 work items and runs at most 30 rules. Of those, at most 5 may be rules that read every row they reach: Keep work items containing text, Group by field, Group by linked work item and Sort by field. A rule past either cap doesn't run and says so.
A hierarchy's rules stop at its limits: past them, nothing more is read or kept. People who may edit the hierarchy are warned once it is within 500 rows or work items of a limit. See A notice says a limit was reached.
When a rule reaches a limit, the app keeps what it built so far, and a notice next to the row count names the limit, for example "some rule results were left out (row limit reached)". The notices for the 20,000-work item limit and the time limit show to everyone. A row, work items-per-rule, depth or level notice shows only to people who can see at least one of the work items it left out. The Rules panel marks the rule that stopped. Admins can raise the limits in Rule limits.
Moving rows that rules placed
Rows that rules placed come from Jira data, so you can't move them freely. When you move one, the app changes that data in Jira on your behalf, and the rules then show the work item in its new place:
- Moving a work item up or down among its siblings ranks it in Jira. A list sorted by another field keeps that order.
- Moving a work item to another group of the same grouping sets the grouped field. A status changes through the workflow transition that leads there, and a sprint through Jira's sprint and backlog actions.
- Moving a work item under another work item changes its parent, or its link, so that it matches how the other work items there are placed.
The app checks a move before it changes anything and refuses one it can't carry out cleanly, such as a move between groups made by name or by linked work item, or one that changes a field like work type or project. For a link, the app creates the new link before it removes the old one. A line under the toolbar says what changed in Jira and names any work item Jira refused, with the reason.
Rows placed by hand and rows placed by rules can't be moved together.
Changes inside rule output
People with Control on a hierarchy can let people with Edit adjust what the rules placed. The setting is Let people with Edit change rule output by hand, on the Access tab of the hierarchy's settings. With it on, you can:
- move rows the rules placed among their siblings, without ranking them in Jira (marked ↕);
- hide work items the rules placed;
- place rows of your own, such as folders or other work items, under rows the rules placed.
None of this changes Jira. Inside rule output, in the Panels menu right after Rules, shows how many changes there are, such as Inside rule output (2), and opens a side panel that lists them. There you can show hidden work items again, Clear my changes, or Clear all changes… made by anyone. If you turn the setting off, the changes are kept but have no effect until you turn it on again.
A row placed by hand whose rule row no longer exists shows at the top level, marked ⇡.
Rule presets
A preset is a saved set of rules you can apply in one step at another place, in the same hierarchy or another one. At the bottom of the Rules panel, Save rules as a preset… keeps the rules at the top level, or those under the focused row. Tick Share with everyone to let others use it. They see the rules but nothing else from your hierarchy.
To use a preset, pick it under Presets and select Apply preset. Its rules go through the same checks as rules you add by hand. A rule that no longer fits the site, for example one that names a deleted field, is left out with a note.
Hierarchies that add other hierarchies
An Add another hierarchy rule puts another hierarchy's work items into this one. The rule runs for everyone, but the rows it brings show only to people who may open the hierarchy it adds, with View or more.
Who sees which rows
- Someone who can open this hierarchy but not the one it adds sees this hierarchy without those rows, and without anything under them.
- This holds along a chain. If A adds B and B adds C, someone who can open A and B but not C sees none of C's rows in A.
- It holds wherever the app shows the rows: the grid, the work item panel, Rovo and the REST API.
- Changes that people made by hand to a held-back row stay held back with it.
- A Scratchpad can't be added to another hierarchy: the rule is refused with "A scratchpad can't be added to another hierarchy." A rule that already adds one keeps its rows from everyone but the Scratchpad's owner, and you should point it at another hierarchy.
- Jira search is the one exception, once someone turns it on:
treecraftHierarchy()looks at every work item the hierarchy holds. See What turning on search reveals.
Questions about the app? Ask us in Plugincraft Support, our help center, or write to info@plugincraft.ca.