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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

975 views 23 12
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