any variable like $currentuser can be used within "Title" Value

This question is in reference to Atlassian Documentation: Create from Template Macro

 

any variable like $currentuser can be used within "Title" Value like $currentDate

2 answers

0 vote
Joe Clark Atlassian Team Jan 08, 2016

This documentation should help you:

https://developer.atlassian.com/confdev/development-resources/confluence-architecture/confluence-internals/velocity-template-overview/confluence-objects-accessible-from-velocity

The current user is available in a variable called $remoteUser. To get the current date, you can use $dateFormatter.currentDate

 

 

Hello Joseph,

in our company we're trying to make the entry to confluence as easy as possible. To do so, we created a template that allows users to follow certain steps, when starting to wright content into confluence. We thought, it would be nice, if users don't need to type their names and the current date. Unfortunatly the variables you suggested do not work ($remoteUser and §dateFormatter.currentDate). Additionally we would like to have a certain field called "title" to automatically put whats typed here as page title. Is their any way to do that? Thanks in advance!

 

Nadja

Hi,

If you like to used standard confluence pages as templates or blueprints and use different kind of variables in a simple way (e.g. __Current_User__, __Current_date__, __Template_Version__), then you should have a look at our plugin Page Tree Creator.

Marketplace Link : Page Tree Creator

Regards,
Stephan

The following example displays the current user’s company name, as well as the status of the current user (which returns a Boolean value).

1<apex:page>
2  <h1>Congratulations</h1>
3   This is your new Apex Page
4   <p>The current company name for this
5      user is: {!$User.CompanyName}</p>
6   <p>Is the user active? 
7      {!$User.isActive}</p>
8</apex:page>

Tutuapp 9Apps Showbox

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 ...

869 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