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.
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>User Parameters
Issue
Issue ID or Isse Key e.g. UM-333
You May Also Like
User macro for displaying issues using custom JQL filter
Display Jira issue comments in a table
List issues (work items) from Jira to get essential information in a readable and well-organized format
List out a table to display the assignee history for Issues by JQL. Shows the following information: Issue Key, Summary, and Assignee history
Find image within page attachments. Handy for reuse files and update them all at once
Show filtered issues and their relations
Display Confluence users filtered by their email addresses.
Displays a list of pages in specific space with certain title or label
Use sticky previous/next buttons to navigate through your Confluence page tree in a linear reading order
Display a list of Confluence pages with CSV download feature