Wiki-Page with list of timePoints using Velocity

Description
fezze
Posts: 2
Joined: Mon Nov 01, 2010 10:23 am

Wiki-Page with list of timePoints using Velocity

Postby fezze » Wed Nov 03, 2010 12:08 pm

Hello,

I want to have a Wiki-Page with a table. Each row shall give information about a timePoint.
At present I am doing it in the following way:

Code: Select all

{table}
    timePoint| No Of Defects
    #foreach ($i in ["timePoint1","timePoint2","timePoint3"])
       $i|{workitems: timePoint.id:$i AND type:defect | display=count}
    #end
 {table}

But whenever a new timePoint has been created, my Wiki-Page needs to be changed.
Is there a way to get all defined timePoints "automatically"? Something like

Code: Select all

    (...)
    #foreach ($i in [List_Of_All_Defined_TimePoints]
    (...)

I found the documentation of "ITimePointsManager.getTimePoints(IContextId contextId, java.lang.String sort, boolean traverseDown)"
And the promise "Returns all time points applicable to given context. "

I tried this:

Code: Select all

#set ($TP = ITimePointsManager.getTimePoints(MyProjectId,null,true))
{table}
    timePoint| No Of Defects
    #foreach ($i in [$TP])
        $i|{workitems: timePoint.id:$i AND type:defect | display=count}
    #end
{table}

Yet alone, what ever I try: I get exceptions about any "encountered" things or missing brackets. Not even the "#set" works...
I unfortunately do not understand the documentation in a way that would be helpful to me.
May I ask if anyone knows what the code must look like, to reach my target?

Best regards,
fezze

thk007
Posts: 3
Joined: Wed Mar 10, 2010 7:46 am

Re: Wiki-Page with list of timePoints using Velocity

Postby thk007 » Wed Nov 24, 2010 6:38 am

You may try it this way:

Code: Select all

    #set($projectId = $doc.getProject($doc.space))
    #set($project = $trackerService.getTrackerProject("$projectId"))
    #set ($TP = $trackerService.timePointsManager.getTimePoints($project.getContextId(),null,false))
{table}
    timePoint| No Of Defects
    #foreach ($i in $TP)
        $i.getName() | {workitems: timePoint.id:$i.getId() AND type:defect | display=count}
    #end
{table}

fezze
Posts: 2
Joined: Mon Nov 01, 2010 10:23 am

Re: Wiki-Page with list of timePoints using Velocity

Postby fezze » Wed Nov 24, 2010 11:30 am

Great! That is exactly what I was looking for!

Thank you!


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Google [Bot] and 9 guests