Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

(User Macro) How to feed data into velocity template parameter

kevin anderson
Contributor
October 31, 2013

Is there a way to push data into a velocity template parameter of type enum?

example...I would like to have a drop down with all the confluence user groups listed in the parameter selection screen (user macro edit mode)

## get all user groups
#set ($_allGroups = $userAccessor.getGroupsAsList())
#set ($_grpNames = "")

#if ($_allGroups)
#foreach ($_group in $_allGroups)

#set ($_grpNames = "$_grpNames,$_group.getName")

#end

#end

## this does not work...( type=enum|enumValues=$_grpNames )

## @param _group:title=Groups|type=enum|enumValues=$_grpNames|required=true|desc=The LDAP group name to perform search for members in, if no group is provided, default is all users.

1 answer

1 vote
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2013

User macro parameters are just velocity comments that Confluence interprets and creates Velocity variables from. So, nope it's not possible ... it would be nice if they beefed up the variable types a bit (attachments, users, groups, etc.).

ignaciogiri
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 2, 2016

Thanks for clarifying. I've been looking for this answer the last 2 hours.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events