This template displays the number of inward links leading to the current work item. E.g. the link “A blocks B” is counted in B, but not in A.
Note that this counts the links themselves, not distinct linked work items, which might be fewer.
Configuration
To use the Count incoming links template, simply select it from the template grid. Filter by Links to find it faster.
Parameters
This template does not require any additional parameter configuration.
Expert mode
If you switch to Expert mode you can see the formula field in the Expression Parser. You can now tweak the expression to create a custom formula field based on this template.
Expression
Jira expression:
issue?.links?.filter(link => link.direction == "inward").length
Display as
Number
Formatting style
Default (unformatted)
Details
1. What does the expression do?
The expression counts the number of inward links (incoming relationships) that point to the current work item. For example, if work item A blocks work item B, this link is counted for B (the target), not for A (the source).
2. Step-by-step breakdown
Let’s break it down:
-
issue?: Refers to the current work item. -
.links?: Refers to the list of all links associated with the current work item. -
.filter(link => link.direction == "inward"): This filters the list of links, keeping only those where the direction is "inward" (i.e., links coming into this work item from others). -
.length: Counts how many links remain after filtering—in other words, the total number of inward links.
3. Examples
-
If work item B has three links: one "blocks" A (outward), one "is blocked by" C (inward), and one "is duplicated by" from D (inward), the expression will count 1 (the links from C and D).
-
If there are no inward links, the result will be 0.
4. Real-life use cases
-
To quickly see how many other work items are referencing or blocking the current work item.
-
To identify work items that are heavily depended on by others (many incoming links).
-
To create dashboards or reports showing which work items are most "in demand" or critical due to incoming dependencies.