This user macro retrieves a list of Jira issues using JQL and displays their assignee change history in a structured table within Confluence. For each issue, the macro shows a clickable issue key linking to Jira, the issue summary, and a chronological assignee path using user mentions. It leverages Jiraβs changelog via the REST API to detect assignment changes, sorts them by creation time, and presents the sequence using '>' notation. If no results match the JQL, it displays a helpful message.
## Search for issue with key, summary, and changelog included
#set ( $issues = $JiraManager.get("/rest/api/3/search/jql?fields=key,summary,assignee&expand=changelog&jql=${parameters.jql}").issues )
## Jira URL is a Confluence baseURL, but w/o "wiki/"
#set ( $jiraURL = $StringUtils.replace($baseUrl, "/wiki", "") )
## Check for empty result
#if(!$issues)
No issues for JQL <code>${parameters.jql}</code></a>
#stop ## End of execution, there is nothing to render
#end
<table>
<thead>
<tr>
<th>Issue</th>
<th>Summary</th>
<th>Assignee history</th>
</tr>
</thead>
<tbody>
## Loop through issues
#foreach ( $i in $issues)
<tr>
<td style="white-space: nowrap;"> ## "nowrap" for issue key to be in one line
<a href="${jiraURL}/browse/${i.key}">$i.key</a>
</td>
<td>$i.fields.summary</td>
<td>
#if ( $i.changelog.histories )
## Sort history items by creation date ascending
#set ($sortedHistory = $SortTool.sort($i.changelog.histories, ["created"]))
#foreach ( $h in $sortedHistory )
#foreach ($item in $h.items)
#if ($item.fieldId == "assignee")
#if ($item.from)
<ac:link><ri:user ri:account-id="${item.from}"/></ac:link> β
#else
<span class="aui-lozenge aui-lozenge-subtle">unassigned</span> β
#end
#end
#end
#end
#end
## Current Assignee
#if ($i.fields.assignee)
<ac:link><ri:user ri:account-id="${i.fields.assignee.accountId}"/></ac:link>
#else
<span class="aui-lozenge aui-lozenge-subtle">unassigned</span>
#end
</td>
</tr>
#end
</tbody>
</table>User macro for displaying issues using custom JQL filter
Space Information macro by space Id
Display a list of Confluence pages with CSV download feature
Shows worklogs from the Jira issue
Display a list of clickable labels for a specified page tree
Macro for generating ID in base32 format
Display page edit and view restrictions in Confluence to get essential permission details, including users, groups, and inherited access.
Use sticky previous/next buttons to navigate through your Confluence page tree in a linear reading order
Display Confluence users filtered by their email addresses.
Shows page creation date