Is it possible to retrieve the labels of one (1) particular page?
Say, I want to use the label(s) of a page as a value in a Page Properties key/value pair without having the editor putting that infomation in there manually (he only needs to add the label to the page).
Is this possible with standard Confluence functionality?
Well there are guides, and samples out there. There is also a complex sample that deals with labels here:
And yes there is a learning curve, but user macros allow you to fill in the holes in Confluence. And when I started, I knew nothing about VTL or Java. ;-) So it will take time to create this first macro, but the time will pay dividends later.
If you look at this code:
You will see examples. The author first calls the needed functions:
#set( $pageManager=$containerContext.getComponent('pageManager') )
Now the methods can be accessed. So for example:
#set( $currentPage = $pageManager.getPage($content.id) )
Then you can do something like this
#set( $labels = currentPage.getLables( ))
Spend some time breaking down how the autor constructed the macro will help a lot in learning these tricks.
thanks for the response, however, that is not the answer i'm seeking..
In fact, I want to know if it is possible, using standard Confluence functionality, to retrieve the label on a page automatically in a Page Properties field on that same page, so that i can report that label in the table that is automatically generated by a Page Properties Report macro.
I want to avoid that people need to add the label and secondly, the same label information in a properties field.
Phew, Atlassian Team 2021 blew by. With dozens of demos and a handful of keynotes, you may have missed some of the awesome Confluence Cloud sessions. Don't' worry, you can watch them all here or on Y...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events