<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Verdana","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Verdana","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal>Is it possible to get search results with a sum of the
TimeTaken values from the Transactions table?<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Our internal developers need to fill out time sheets each
week. At the moment this is labour intensive so I have been trying to work out a
way to pull the time out of the tickets for the previous week.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>I thought I had it with the following:<o:p></o:p></p>

<p class=MsoNormal>Search Query:<o:p></o:p></p>

<p class=MsoNormal>Owner = '__CurrentUser__' AND Updated > '1 week ago' AND
TimeWorked > 1<o:p></o:p></p>

<p class=MsoNormal>Results format:<o:p></o:p></p>

<p class=MsoNormal>'<a
href="/rt/Ticket/Display.html?id=__id__">__id__</a>/TITLE:#',<o:p></o:p></p>

<p class=MsoNormal>'<a
href="/rt/Ticket/Display.html?id=__id__">__Subject__</a>/TITLE:Subject',<o:p></o:p></p>

<p class=MsoNormal>'__Priority__',<o:p></o:p></p>

<p class=MsoNormal>'__QueueName__',<o:p></o:p></p>

<p class=MsoNormal>'__ExtendedStatus__',<o:p></o:p></p>

<p class=MsoNormal>'__TimeWorked__',<o:p></o:p></p>

<p class=MsoNormal>'__TimeEstimated__'<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>This returns all tickets that have been worked on the last
week, but shows the total time ever worked on the ticket, which isn’t any
good.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>I see the transactions table contains a TimeTaken value. The
ideal solution would be to add up all the TimeTaken values from the last 7 days
and display them in the search results.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>I thought maybe I could have modified the <a
href="http://wiki.bestpractical.com/view/TimeWorked">http://wiki.bestpractical.com/view/TimeWorked</a>
code, but the date part of that didn’t, and I have been unable to get it
to work. It just returns all results from every queue.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Any pointers? After spending the last week working on RT and
reading the wiki and mailing lists I am stuck.<o:p></o:p></p>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Thanks,<o:p></o:p></p>

<p class=MsoNormal>Alex<o:p></o:p></p>

</div>

</body>

</html>