I wonder if there is a macro or some other method to display some of a page's labels and exclude others. For example, if a page has labels book, drama, and historical, I only want to display drama and historical since it's already clear from context that this is a book.
I have been using the Page Info macro to list labels, and sometimes the Report Info macro from ServiceRocket's Reporting plugin. Neither one has an option to list some labels but not others.
Hi @Michelle_Rau ,
There is no macro available out of the box to achieve what you are asking for, however, this can be done with a User Macro.
I have create the below one as an example and it works fine on my test instance.
## Macro title: page-labels-not-in-list
## Macro has a body: N
## Developed by: Dario
## Date created: 7/11/2019
## Installed by: Dario
## @param Label:title=Label|type=string|required=true|desc=List of labels comma separated
#set($labelList = $paramLabel.split(","))
<h2>List all labels for the page, excluding: $paramLabel </h2>
#foreach($pageLabel in $content.getLabels())
#set($found = 0)
#foreach ($label in $labelList)
#if($pageLabel == $label)
#if($found == 0)
Can you kindly test it and confirm it works for you as well?
Hi @Michelle_Rau ,
Please notice that I just provided a very easy example of a user macro that prints all the labels from the current page, excluding the ones provided in input.
As it is, the macro is just writing a line of text followed by the list of labels (excluding the ones configured as the input for the macro):
You will have to extend and modify the according to your needs.
Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...
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