Hi,
I'm looking to create a user macro in Confluence that creates a button. when the button is pressed, some labels are added to the page and some gets removed. I figured I would need three parameters:
1. Label of the button (the text that appears on the button)
2. Labels to add (a list of labels, that I want to tag the current page with)
3. Labels to remove (a list of labels, that I want to remove from the current page)
Ideally it would ignore duplication (so if the page was already tagged with the label, it won't give an error and would just ignore adding it again) and also would ignore removing labels that were not there to begin with.
How would I do that? I only managed to define the parameters, but stuck after that:
## Macro title: Replace page labels
## Macro has a body: N
## Body processing: No macro body
## @param ButtonLabel:title=Button's label|type=string|required=true|desc=Enter the text that would appear on the button
## @param LabelsAdded:title=Labels to add|type=string|desc=Enter one or more labels to be added to the page
## @param LabelsRemoved:title=Labels to remove|type=string|desc=Enter one or more labels to be removed from the page
Thanks,
Peter