User Macro to Get a count of likes or comments on a page?

Alex Kulichkov August 24, 2021

Hello, 

 

Can anyone help with custom macro to display number of likes (or comments) on a page?

 

I'm trying to populate "page properties report" but build in likes/comments count functionality has a bug and column headers don't display likes/comments.

 

So i'm building out template for "page properties" macro to capture the data and than pull it on higher up report page. 

 

Thanks in Advance!

1 answer

1 accepted

1 vote
Answer accepted
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2021

Hi @Alex Kulichkov 

I only get the answer for the comments:

#set( $page = $pageManager.getPage($content.getId()) )
Comments: $page.getComments().size()

For the likes, I do not know how to get it. Sorry.

Regards, Dominic

Alex Kulichkov August 25, 2021

Hi @Dominic Lagger , 

 

Thanks for the answer, i think i know the variable for likes.

 

One question is it all i need to include in Custom Macro?

 

Best,

Alex

Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2021

My full "No macro body" looks like this:

## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name

## @noparams

#set( $page = $pageManager.getPage($content.getId()) )
Comments: $page.getComments().size()

Please share your code for the likes. I'm interessted into this.

Regards, Dominic

Alex Kulichkov August 26, 2021

Thanks for the full code, comment count works, but we are still researching one for likes.

We tried likesManager.getlikes() but it didnt work. 

 

We will be working with Atlassian to find the solution and post it here once found!

Like Dick likes this
Akseli Hakli January 23, 2022

Hey. Did you end up finding a solution with Atlassian?

Like Tia Marciel likes this
Tia Marciel August 9, 2023

yes, any updates?

Like Firas Chikhrouhou likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.12.3
TAGS
AUG Leaders

Atlassian Community Events