This user macro fetches worklogs from a Jira issue and displays them in a sortable table within a Confluence page. It uses the Jira REST API to pull data including creation date, author, time spent, and worklog comments. Comments are parsed from Atlassian Document Format (ADF) to plain text for readability. If no worklogs are available, a friendly message with a link to the issue is shown. The macro auto-updates when worklogs change, ideal for time tracking visibility or project retrospectives.
#set ( $worklogs = $JiraManager.get("/rest/api/3/issue/${parameters.issue}/worklog").worklogs)
#set ( $jiraURL = $StringUtils.replace($baseUrl, "/wiki", "") )
#set ( $issueURL = "${jiraURL}/browse/${parameters.issue}" )
#if(!$worklogs)
No worklogs for issue <a href="$issueURL">${parameters.issue}</a>
#stop
#end
<table class="aui">
<thead>
<tr>
<th colspan="4"><center>Worklogs for issue <a href="$issueURL">${parameters.issue}</a></center></th>
</tr>
<tr>
<th>Date</th>
<th>Author</th>
<th>Time spent</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
## Loop through worklogs
#foreach ( $w in $SortTool.sort($worklogs, ["created:desc"]) )
<tr>
<td>$StringUtils.substringBefore($w.created, "T")</td>
<td><ac:link><ri:user ri:account-id="${w.author.accountId}"/></ac:link></td>
<td>$w.timeSpent</td>
<td>
#if ( $w.comment ) ## Comment might be empty
## Parse comment from Atlassian Document Format (ADF)
#foreach ( $c in $w.comment.content[0].content )
#if ($c.type == "text")
$c.text
#end
#end
#end
</td>
</tr>
#end
</tbody>
</table>Display issues using a custom JQL filter
Display Jira issue comments in a table
Display a table showing the assignee history for issues based on JQL. The table includes the following information: Issue Key, Summary, and Assignee History.
List Jira issues (work items) to display essential information in a readable and well-organized format
Find images within page attachments. Handy for reusing files and updating them all at once.
Show filtered issues and their relations
Display Confluence users filtered by their email addresses
Use sticky previous/next buttons to navigate through your Confluence page tree in a linear reading order
Display a list of Confluence pages with a CSV download feature
Display a list of clickable labels for a specified page tree