Breadcrumbs

Keys of linked work items in current project

๐Ÿ“š

Return the keys of the linked work items that are in the same project as the current work item.

Configuration

Create a Custom smart text field and use the General parsing mode.

Expression

%{filterByProject(linkedIssues(), %{issue.project.key})}

Used parser functions

The links lead to the JWTC documentation because the parser functions are shared functionalities.

Details

1. What does the expression do?

The expression returns the keys of all work items that are linked to the current work item and are in the same project as the current work item.

2. Step-by-step breakdown

Let's break it down:

  • linkedIssues(): This function retrieves all work items that are linked to the current work item, regardless of which project they belong to.

  • %{issue.project.key}: This retrieves the project key of the current work item.

  • filterByProject(linkedIssues(), %{issue.project.key}): This function takes two arguments:

    • The list of linked work items (from linkedIssues()).

    • The project key of the current work item.
      It filters the list of linked work items, returning only those that belong to the same project as the current work item.

3. Examples

Suppose you have a work item "PROJ-123" in the "PROJ" project. This work item is linked to:

  • "PROJ-124" (same project)

  • "PROJ-125" (same project)

  • "OTHER-10" (different project)

The expression will return: PROJ-124, PROJ-125

4. Real-life use cases

  • You want to display or report only the linked work items that are relevant to the current project, ignoring links to work items in other projects.

  • When creating custom fields or reports, you may want to focus on relationships within the same project for better project tracking or analysis.

  • This can help project managers quickly see dependencies or related work items that are only within their current project scope.