Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confluence user is not allowed to call function / user macro

Andreas Kolbe July 5, 2017

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

1 vote
Answer accepted
Andreas Kolbe July 14, 2017

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
TAGS
AUG Leaders

Atlassian Community Events