Stand with Ukraine 🇺🇦

Related Issues — Confluence Cloud Macro

external-contentreporting

The macro retrieves and displays a list of Jira issues and their related linked issues in a structured table format.

Try for free

User Parameters

JQL

Use JQL to filter issues (and their relations) you woul like to show

Template

## Making a request and set result into $defects var

#set($defects = $JiraManager.get("/rest/api/3/search/jql?jql=$parameters.jql").issues)

 ## Create a Issue URL var for linking simplicity
 #set($jiraUrl = $StringUtils.replace($baseUrl,"/wiki",""))
 #set($issueUrl = "$jiraUrl/browse/")

## Table header
 <table class="aui aui-table-list">
     <thead>
         <tr>
             <th>Issue</th>
             <th>Related</th>
             <th>Issue Type</th>
         </tr><tr>
     </tr>
     </thead><tbody>

 ## Table body
 #foreach ($defect in $defects)
         <tr>
             <td colspan="2"><img src="$defect.fields.priority.iconUrl" title="$defect.fields.priority.name" height="15px"><a href="$issueUrl$defect.key">$defect.key</a> $defect.fields.summary</td>
             <td><img src="$defect.fields.issuetype.iconUrl">$defect.fields.issuetype.name</td>
         </tr>
   ## Internal loop through linked issues
   #foreach ($link in $defect.fields.issuelinks)
     ## skip inwardIssue, show only outwardIssue
     #if ( $link.outwardIssue )
         <tr>
             <td></td>
             <td><img src="$link.outwardIssue.fields.priority.iconUrl" title="$link.outwardIssue.fields.priority.name" height="15px"><a href="$issueUrl$link.outwardIssue.key">$link.outwardIssue.key</a> $link.outwardIssue.fields.summary</td>
             <td><img src="$link.outwardIssue.fields.issuetype.iconUrl">$link.outwardIssue.fields.issuetype.name</td>
         </tr>
     #end
   #end
 #end

 ## Table footer
     </tbody>
</table>