Looking for help with writing a macro to audit the pages within a space in a Confluence instance, showing the following fields:
Previous implementation was deployed on a created page within the space being audited, and showed a table of all the pages within the space.
@Michael Zhao - hi Michael!
Are you actually looking for a Power Scripts for Confluence script?*
If no, or it's not imperative that we use PS, consider a custom user macro:
* today I learned that PS for Confluence is a thing! Awesome.
Definitely looks like it matches what I'm looking for. Talked to a former colleague who mentioned the previous iteration was built with Power Scripts, but more looking for a starting point to build it out in a different organizational context, so not a requirement.
Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Michael Zhao - FYI if you have an existing PS script, you may be able to extend it using these variables: https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15306098/Standard+Variables
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Michael Zhao
I'm a PM in Kolekti (Part of the Adaptavist Group) and we currently have a new discovery idea in the works, a Confluence Cloud add-on designed to streamline multi-space metadata and content management for Confluence Cloud users!
The app aims to streamline content management for Confluence Cloud by offering a centralised hub for all your pages. Imagine a "panoramic view" where you can easily:
Your use case sounds very interesting... would you be interested in a conversation?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dave Liao
In case you are using Cloud
It might also be worth to take a look into our (Wombats Corp) app User Macro for Confluence Cloud
You can create numerous dynamic macros from the admin panel.
For your exact use case template would be the following:
## get pages in the current space
#set($sort = "-modified-date") ## order by modified date DESC
#set($status = "current") ## skip archived, deleted, and drafted
#set($limit = 250) ## increase pages limit to maximum
#set($url = "/wiki/api/v2/spaces/${space.id}/pages?sort=${sort}&status=${status}&limit=${limit}")
#set($response = $ConfluenceManager.get($url))
## Use of Atlassian UI (AUI) sortable table
<table class="aui aui-table-sortable">
<thead>
<tr>
<th>Title</th>
<th>Link to Page</th>
<th>Last updated</th>
<th>Original Poster</th>
</tr>
</thead>
<tbody>
## iterate through results of pages
#foreach($page in $response.results)
<tr>
<td>${page.title}</td>
<td><a href="${baseUrl}${page._links.webui}">${page._links.webui}</a></td>
## Convert datetime to date
## "2024-02-13T12:12:31.528Z" -> "2024-02-13"
#set($createdAt = $StringUtils.substringBefore($page.version.createdAt, "T"))
<td>${createdAt}</td>
## Retrieve additional information by accountId
#set ( $user = $ConfluenceManager.get("/wiki/rest/api/user?accountId=$page.authorId") )
<td>$user.displayName</td>
</tr>
#end
</tbody>
</table>
The result would be like this:
Regards, Roman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.