Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Developers will be able to access a service from velocity templates to access UPP data.
The item is called uppVelocityApi from within Velocity.The User Profile Plugin extends the Velocity context by a component which allows to access user profile data from Velocity templates.
The velocity context component has the name uppVelocityApi. It provides one method with the following signature:
getProperty(user, profileElementName):
- This method returns the value of the given profile element for the given user. It accepts the following parameters:
- user: The user to retrieve the value for. Type: com.atlassian.user.User
- profileElementName: Default name of the profile element, typically the English name. Type: String
- Field Profile element names are do not need to be unique. This method will return the value of the first found field with the name, which is visible (i.e. not hidden). To determine the first field, the order as defined at the administration is used.
Usage
Code Block |
---|
#set( $user = $userAccessor.getUser("userWithProfileElement") ) #set($profileElementName = "Mobile Phone" ) ##set($mobileNumber = $uppVelocityApi.getProperty($user, $profileElementName) ) |
Include Page | ||||
---|---|---|---|---|
|