Velocity code to display Document name

Description
AmayB
Posts: 3
Joined: Tue Jun 13, 2017 9:35 am

Velocity code to display Document name

Postby AmayB » Tue Aug 15, 2017 8:36 am

Hi everyone,

I'm trying to build a custom widget in an inline script with Velocity Code. This widget should be approximately like the Traceability Table widget, except that I also want to display the document name in which the linked Work Items are situated. Here's my code:

Code: Select all

<table class="polarion-rpw-table-content">
<tbody>
<tr class="polarion-rpw-table-header-row">
<th>Item</th>
<th>Status</th>
<th>Linked Item</th>
<th>Document</th>
</tr>
#foreach($w in $transaction.workItems.search.query("project.id:project AND document.title:\"Requirements" AND type:requirements"))
<tr class="polarion-rpw-table-content-row">
<td>$w.render.withLinks.withTitle</td>
<td>$w.fields.status.render</td>
<td>
#foreach($l in $w.fields.linkedWorkItems.direct)
#if($l.fields.role.get.id == linkedto)
$l.fields.workItem.render.withTitle.withLinks
#end
#end
</td>
<td>$l.fields().name().get()</td>
</tr>
#end
</tbody>
</table>


The line that doesn't work is:

Code: Select all

<td>$l.fields().name().get()</td>


I know that this code is wrong.

Could somebody please tell me the correct code line?

Thanks in advance.

AmayB
Posts: 3
Joined: Tue Jun 13, 2017 9:35 am

Re: Velocity code to display Document name

Postby AmayB » Fri Aug 18, 2017 5:53 am

For those who could need it, the solution is:

$l.fields().module().get().fields().moduleName().get()


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests