List & choose Plans in a wiki

Description
DCwom
Posts: 37
Joined: Mon Sep 29, 2014 7:00 pm

List & choose Plans in a wiki

Postby DCwom » Mon Feb 02, 2015 9:34 pm

I'm trying to create a wiki page that displays WIs from various plans. I'm trying to get a list of plans within a project and either loop through them or put them in a dropdown box for user selection. I've got the code to find the WIs in a plan but I'm having difficulty finding all the plans in a project. I've tried the following code to discover the plans but I'm not having any luck, I never enter the loop so I assume I'm not getting a list of plans returned (I have 2 plans created). Any Ideas?

Code: Select all

#set($planningManager = $trackerService.getPlanningManager())
#set($planList = $planningManager.searchPlans())

#foreach($plan in $planList)
       InsideLoop\\
#end

rdubos
Posts: 3
Joined: Fri Feb 27, 2015 4:20 pm

Re: List & choose Plans in a wiki

Postby rdubos » Fri Feb 27, 2015 4:35 pm

Hi DCwom,

I have the same issue.
Like you, I try desperatly to get the list of my plans.
I know that the planningManager object is valuated, because I can get a plan using its name and "planningManager.getPlan()", but "planningManager.searchPlans()" seems to be faulty... or most likely I'm using it wrong.

I guess there is a way to get the plans, using "planningManager.getPlan()" and the list of plan's name took from the WI "planned In" attribute. I haven't tried it yet.

If you managed to find another way to get your plans, please write about it.

Regards.

sergeD
Posts: 23
Joined: Tue Feb 05, 2013 9:24 am

Re: List & choose Plans in a wiki

Postby sergeD » Tue Mar 03, 2015 11:02 am

Hi,

To put the plans in a dropdown box for user selection. you can try first:

Code: Select all

{parameter:version|type=enum:@plan|value=Sprint1|allow-no-value=true}
<div style="background-color:\#E1F0FF;padding:5px;">
{parameter-form}
<table cellpadding="3" style="background-color:\#E1F0FF">
<tr><td width=150 align=right>Plans:</td><td>{parameter-editor:version} </td></tr>
</table>
{parameter-form-submit}
{parameter-form-save}
{parameter-form}
</div>
#if($pageParameters.version)
#set($bQuery = "AND PLAN:($page.project/$pageParameters.version.id")
#end
#set ($theQuery="type:systemRequirement AND project.id:$page.project $bQuery ")

It must be possible to get the plans through planningManager but not tried..yet
Hope it helps
sergio

rdubos
Posts: 3
Joined: Fri Feb 27, 2015 4:20 pm

Re: List & choose Plans in a wiki

Postby rdubos » Tue Mar 03, 2015 3:46 pm

Hi Sergio,

{parameter:plans|type=enum:@plan} does allow to display the list of plan in project.

However, I can't browse it in a foreach loop, like this :
#foreach($plan in $pageParameters.plans)
$plan.name
#end


I'm trying to get the name of every plan in my project to use them in a second request.
My goal is to create a chart with the number of work items in each plan of my project.

Thank you for your help,
Roland.

sergeD
Posts: 23
Joined: Tue Feb 05, 2013 9:24 am

Re: List & choose Plans in a wiki

Postby sergeD » Wed Mar 04, 2015 10:11 am

Ok, then i think this code to get first plans list could be helpful for both of you:

Code: Select all

#set($planQuery = "project.id:$page.getProject()")
#set($planMgr = $trackerService.getPlanningManager())
#set($plans = $planMgr.searchPlans("$planQuery","startDate",-1))

<table width=99% cellspacing="0" cellpadding="4" style="table-layout:fixed;border:1px solid black;border-collapse:collapse;" rules="all">
   <th>Plan ID</th>
   <th>Plan Name</th>
   
#foreach($plan in $plans)
<tr><td> #set ($theLink="/project/$plan.getProjectId()/plan?id=$plan.getId()")
* {portallink:$theLink } $plan.getId() {portallink}</td>
<td>$plan.getName() </td></tr>
#end
</table>

sergio

rdubos
Posts: 3
Joined: Fri Feb 27, 2015 4:20 pm

Re: List & choose Plans in a wiki

Postby rdubos » Thu Mar 05, 2015 9:39 am

Perfect, it's working fine !

Thanks you very much.

lucygp
Posts: 3
Joined: Fri Mar 06, 2015 2:01 am

Re: List & choose Plans in a wiki

Postby lucygp » Fri Mar 06, 2015 2:43 am

I'm trying to get the name of every plan in my project to use them in a second request.











_____________________________________
Fut coins


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 28 guests