Welcome to the first of a series of tips and tricks from the Polarion Software Technical Support team. In this series we’ll be showcasing solutions to several use cases that we provided to customers. The positive response we got from the customer in each case led us to think that these tips might help other Polarion users too. So let’s begin with how to query for values in the Remaining Estimate field of Work Items starting from a certain date.
Search for remaining (or initial) estimates in a given time range.
- All implementation tasks of a project shall be finished end of November 2013.
- In the Live Plan I see, that some tasks exceed this deadline.
- Today is 3 days before the end of November 2013 which means I need to find workitems having remaining estimate longer than 3 days
Customer’s question: “I would like to know how much remaining work will be open after end of November.”
Here a several examples you can use in Wiki pages:
1. Tasks with some Remaining Estimate
#set($projectId = $page.getProject())
#set($tasks = $trackerService.queryWorkItems(“project.id:$projectId AND type:task =>
* Number: $tasks.size()
=> indicates line continuation
2. The DurationType Object – value minus 3d
#set($duration3d = $tasks.get(0).getRemainingEstimate().parseDuration(“3d”))
* Duration: $duration3d.toString()
#set($x = $duration3d.setNegative(true))
* Negative: $duration3d.isNegative()
3.Find Tasks with Remaining Estimate value of more than three days
#foreach($task in $tasks)
#set($re = $task.getRemainingEstimate())
#set($x = $re.add($duration3d))
* Task: $task.getId()
* Overdue: $re
For the sum of the overdue time you need another DurationTime variable:
#set($total = $tasks.get(0).getRemainingEstimate().parseDuration(“0d”))
In the foreach cycle you can sum the overdue values:
#set($x = $total.add($re))
and display the total value after the cycle.
It would be better if you tested the number of tasks and continue only if there is a non-zero number of them:
Here’s hoping you might find these tips useful sometime. Watch the blog or RSS feed for more Tech Tips from Polarion Technical Support.
Jiri Jandl is a Senior Support Engineer with Polarion Software’s European tech support team. He is based in Prague, Czech Republic.