Hello,
I want to insert a document custom field to a wiki content of the same document.
The ID of my custom field is documentAuthor and I'm looking for a code similar to "$document.getAllWorkitems()" and instead of workitems I need the information of the custom field.
Does anybody know how to solve my problem?
Kind regards!
Use Document Custom Fields in a Wiki Content
Re: Use Document Custom Fields in a Wiki Content
I just figured it out on my own:
I used the following code and it worked:
#set($customFieldID = "documentAuthor")
$document.getCustomField($customFieldID)
The ID is configured in the custom field configuration and $document automatically points to the document in which I'm adding the wiki content.
I used the following code and it worked:
#set($customFieldID = "documentAuthor")
$document.getCustomField($customFieldID)
The ID is configured in the custom field configuration and $document automatically points to the document in which I'm adding the wiki content.
Re: Use Document Custom Fields in a Wiki Content
Hi,
worked for me (after replacing "myDocument" with the name of the document to work with, of course).
Regards,
Michaeö
Code: Select all
#set( $project = $trackerService.getProjectsService().getProject($trackerService.projectsService.getProject($page.getProject()).getId()) )
#set( $module = $trackerService.getModuleManager().getModule($project, $project.location.getLocation("myDocument")) )
#set( $cfContent = $module.getCustomField($cfBranchedFrom) )
worked for me (after replacing "myDocument" with the name of the document to work with, of course).
Regards,
Michaeö
Return to “Polarion Application Lifecycle Management (ALM)”
Who is online
Users browsing this forum: araceliej3, tiasu1 and 13 guests