Issue Worklogs — Confluence Cloud Macro
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.
User Parameters
Issue
Issue ID or Isse Key e.g. UM-333
Template
#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>Recommended Macros
User macro for displaying issues using custom JQL filter
List out a table to display the assignee history for Issues by JQL. Shows the following information: Issue Key, Summary, and Assignee history
Display Jira issue comments in a table
Content that is shown only if a user is in a particular group
Shows H1 headings directly to children's topics for easy navigation.
Space Information macro by space Id
Display the groups a specified Confluence user belongs to in different formats.
Macro for printing all the spaces