Confluence user is not allowed to call function / user macro

I guess something went wrong, so second try.

Hi. We like to collect some information within a form from a template. The global blueprint contains the vars the worker should fill with information. The user goes to the main page and hit a link. An assistant opens and the worker can choose the right Form. The Site is created from the Blueprint. Then a user macro fills the Heading like that:

Unbenannt.png

This is necessary, because just the time makes the form unique!

Because it wasn't possible for me to make a Blueprint with Heading containing: Date AND Time, (with the official macro: "Add New Page From Template" you could only add @currentDate, no time), I tried to write my own user macro and it works for me as Confluence Admin. But the Confluence users aren’t allowed to call some function?!? We need that, because if a worker had to do two or more times these steps, the first Site of the day will be overwritten (without warning).   I’am not a Programmer… but was able copy together some lines from the Community.

## @noparams

#set($wikibaseurl = "${req.getContextPath()}")
#set($templateid="3932192")
#set($fromspacekey=$space.getKey())
#set($frompage=$content.getTitle())

#set($newspacekey=$wikibaseurl)
#set($templatename=$paramtemplate)
#set($title=" Fehlerprotokoll vom: " + $action.dateFormatter.formatGivenString("dd-MMM-yyyy hh:mm:ss", $content.currentDate) + " test")

##(blueprint)
<a href='$wikibaseurl/pages/createpage-choosetemplate.action?title=$title&templateName="ETH-Fehlerprotokoll global"&templateId=$templateid&linkCreation=false&spaceKey=$fromspacekey&newSpaceKey=$newspacekey&fromPageId=65831'>$body</a>

How could I adapt the code, in that way, a Confluence user is able to add a new form from Blueprint without Admin rights? Sure, I know that there a lot of commercial Add Ons, but this had to work without.

Thanks

1 answer

1 accepted

My Solution:

I found a free Addin named Linking witch has the {add-page-form} macro. This is exactly waht we searched for.

This was the first Addin i installed witch made a restart on the server instance necessary.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,785 views 25 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you