Good afternoon all,
i want to use the "decisions" feature in combination with the decision log in a project. To use it, it is necesarry to have an automatic ID, which is given with each creation of a decision. I am using Confluence Server V. 8.9.8.
To create such ID i wrote a confluence user macro, but it doenst work so far (it just shows the last two lines of code in plain text) and to be honest being a first timer with macros, velocity is a bit confusing. I guess i got something wrong with the syntax.... Could someone check the code or give other advice to solve my issue with a macro?
I already changed the blueprint of the decision feature, so i hope by getting the code straight, it shall work quickly.
Here is the code:
#** ======== AUTOMATIC DECISION ID ASIGNMENT
This Confluence user macro creates an ID for decisions and increments it with each new decision creation.
Version: 1.0.0 Updated: 13.12.2024
Author/s: Johannes Klever
Macro Body Processing: No macro body
*# #** ---------------------------------- PARAMETER #*
## @Param prefix:title=Prefix|type=string|required=false|desc=Add a prefix to the ID
#** ----------------------------------------------------- OUTPUT #*
#set($increment = $action.getPersistentProperties().get("decision-id-counter")) #if(!$increment)
#set($increment = 1)
#else #set($increment = $increment + 1)
#end
$action.getPersistentProperties().put("decision-id-counter", $increment) $paramPrefix$increment