Use Document Custom Fields in a Wiki Content

Description
jejahner
Posts: 6
Joined: Wed Jun 14, 2017 1:16 pm

Use Document Custom Fields in a Wiki Content

Postby jejahner » Tue Jun 20, 2017 12:05 pm

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!

jejahner
Posts: 6
Joined: Wed Jun 14, 2017 1:16 pm

Re: Use Document Custom Fields in a Wiki Content

Postby jejahner » Thu Jun 22, 2017 8:08 am

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.

micdal
Posts: 13
Joined: Thu Feb 09, 2012 6:22 am

Re: Use Document Custom Fields in a Wiki Content

Postby micdal » Mon Jul 10, 2017 5:29 am

Hi,

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: No registered users and 1 guest