{"id":678,"date":"2014-06-18T19:03:02","date_gmt":"2014-06-19T02:03:02","guid":{"rendered":"https:\/\/blogs.plm.automation.siemens.com\/t5\/Polarion-Blog\/Tech-Tips-amp-Tricks-Query-39-remaining-estimate-39-from-a\/ba-p\/380863"},"modified":"2026-03-26T05:29:43","modified_gmt":"2026-03-26T09:29:43","slug":"tech-tips-remaining-estimate-from-a-specific-date","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/polarion\/tech-tips-remaining-estimate-from-a-specific-date\/","title":{"rendered":"Tech Tips &#038; Tricks: Query &#039;remaining estimate&#039; from a specific date"},"content":{"rendered":"<p>Welcome to the first of a series of tips and tricks from the Polarion Software Technical Support team. In this series we&#8217;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&#8217;s begin with how to query for values in the <EM>Remaining Estimate&nbsp;<\/EM>field of Work Items starting from a certain date.&nbsp;<!--more--><br \/>\n<H2>Use Case<\/H2><br \/>\nSearch for remaining (or initial) estimates in a given time range.<\/p>\n<p><STRONG>Example:<\/STRONG><br \/>\n<UL><br \/>\n\t<LI>All implementation tasks of a project shall be finished end of November 2013.<\/LI><br \/>\n\t<LI>In the Live Plan I see, that some tasks exceed this deadline.<\/LI><br \/>\n\t<LI>Today is 3 days before the end of November 2013 which means I need to find workitems having remaining estimate longer than 3 days<\/LI><br \/>\n<\/UL><br \/>\nCustomer&#8217;s question: <EM>&#8220;I would like to know how much remaining work will be open after end of November.&#8221;<\/EM><br \/>\n<H2>Solutions<\/H2><br \/>\nHere a several examples you can use in Wiki pages:<\/p>\n<p><EM><STRONG>1.&nbsp;Tasks with some Remaining<\/STRONG><\/EM><STRONG> Estimate<\/STRONG><br \/>\n<PRE style=\"line-height: normal; border: 1px dashed #999; background-color: #f8f8f8; padding: 10px;\">#set($projectId = $page.getProject())<br \/>\n#set($tasks = $trackerService.queryWorkItems(&#8220;project.id:$projectId AND type:task =&gt;<br \/>\nAND HAS_VALUE:remainingEstimate&#8221;,&#8221;id&#8221;))<br \/>\n* Number: $tasks.size()<\/PRE><br \/>\n<P style=\"font-size: smaller; text-align: right; line-height: normal;\">=&gt; indicates line continuation<\/P><br \/>\n<EM><STRONG>2. The <\/STRONG><\/EM><STRONG>DurationType<\/STRONG><EM><STRONG> Object &#8211; value minus<\/STRONG><\/EM><STRONG> 3d<\/STRONG><br \/>\n<PRE style=\"line-height: normal; border: 1px dashed #999; background-color: #f8f8f8; padding: 10px;\">#set($duration3d = $tasks.get(0).getRemainingEstimate().parseDuration(&#8220;3d&#8221;))<br \/>\n* Duration: $duration3d.toString()<br \/>\n#set($x = $duration3d.setNegative(true))<br \/>\n* Negative: $duration3d.isNegative()<\/PRE><br \/>\n<EM><STRONG>3.Find Tasks with <\/STRONG><\/EM><STRONG>Remaining Estimate<\/STRONG><EM><STRONG> value of more than three days<\/STRONG><\/EM><br \/>\n<PRE style=\"line-height: normal; border: 1px dashed #999; background-color: #f8f8f8; padding: 10px;\">#foreach($task in $tasks)<br \/>\n#set($re = $task.getRemainingEstimate())<br \/>\n#set($x = $re.add($duration3d))<br \/>\n#if(!$re.isNegative())<br \/>\n* Task: $task.getId()<br \/>\n* Overdue: $re<br \/>\n#end<br \/>\n#end<\/PRE><br \/>\nFor the sum of the overdue time you need another DurationTime variable:<br \/>\n<PRE style=\"line-height: normal; border: 1px dashed #999; background-color: #f8f8f8; padding: 10px;\">#set($total = $tasks.get(0).getRemainingEstimate().parseDuration(&#8220;0d&#8221;))<\/PRE><br \/>\nIn the foreach cycle you can sum the overdue values:<br \/>\n<PRE style=\"line-height: normal; border: 1px dashed #999; background-color: #f8f8f8; padding: 10px;\">#set($x = $total.add($re))<\/PRE><br \/>\nand display the total value after the cycle.<\/p>\n<p>It would be better if you tested the number of tasks and continue only if there is a non-zero number of them:<br \/>\n<PRE style=\"line-height: normal; border: 1px dashed #999; background-color: #f8f8f8; padding: 10px;\">#if($tasks.size()&gt;0)<br \/>\n&#8230;<br \/>\n&#8230;<br \/>\n#end<\/PRE><br \/>\nHere&#8217;s hoping you might find these tips useful sometime. Watch the blog or RSS feed for more Tech Tips from Polarion Technical Support.<\/p>\n<p><HR \/><\/p>\n<p><EM>Jiri Jandl is a Senior Support Engineer with Polarion Software&#8217;s European tech support team. He is based in Prague, Czech Republic.<\/EM><\/p>\n<p><HR \/><br \/>\n<P style=\"text-align: center;\"><A href=\"http:\/\/www.polarion.com\/techsupport\/index.php#support-level\" rel=\"nofollow noopener noreferrer\"><IMG class=\"alignnone size-full wp-image-5839\" src=\"http:\/\/community.plm.automation.siemens.com\/legacyfs\/online\/siemensplm_blogs\/2014\/06\/polarion-silver-gold-support.jpg\" alt=\"Banner: It's all about solutions - Polarion Silver and Gold Support\" width=\"700\" height=\"150\" \/><\/A><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to the first of a series of tips and tricks from the Polarion Software Technical Support team. In this series we&#8217;ll be showcasing solutions to several use cases that we provided to customers&#8230;.<\/p>\n","protected":false},"author":54129,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[],"industry":[],"product":[],"coauthors":[],"class_list":["post-678","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/posts\/678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/users\/54129"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/comments?post=678"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":679,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/posts\/678\/revisions\/679"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/media?parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/categories?post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/tags?post=678"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/industry?post=678"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/product?post=678"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/polarion\/wp-json\/wp\/v2\/coauthors?post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}