<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>I'm using the Crontool, yes, but I've also been doing searches on the web interface to see if I could get this to work. My Crontool syntax is something like:<br><br></div>/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \<br></div>--search-arg "status != 'resolved' and LastUpdated <= '3 days ago'" \<br></div>--action RT::Action \<br></div>--verbose<br><br></div>Or:<br><br></div>/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \<br></div>--search-arg "status != 'resolved'" \<br></div>--condition RT::Condition::UntouchedInHours \<br></div>--arg-condition 72 \<br></div>--verbose<br><br></div>This shouldn't be modifying tickets, yet I'm seeing tickets created hours or minutes ago appearing in the results. Same for my RT web searches for similar SQL to what's above.<br><br></div>I'm in the database now, looking at the Tickets table and messing with queries. I just tried this, but got an empty set:<br><br></div>select id, LastUpdated<br></div>from Tickets<br></div>where LastUpdated <= '3 days ago'<br></div>order by LastUpdated DESC<br></div>limit 10;<br><br></div>I'm not surprised I got nothing, as I imagine the '3 days ago' syntax is something RT interprets before giving the query to the database engine. Still, it was worth a shot. I'm now refreshing my knowledge of date math in MySQL so I can query exactly what I want, but I hoped UntouchedInHours would do all that for me. Oh, and yes, LastUpdated does seem to have normal values in it. They're in GMT time, but they seem to be correct.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 2:37 PM, Matt Zagrabelny <span dir="ltr"><<a href="mailto:mzagrabe@d.umn.edu" target="_blank">mzagrabe@d.umn.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alex,<br>
<span class=""><br>
On Mon, Dec 19, 2016 at 12:54 PM, Alex Hall <<a href="mailto:ahall@autodist.com">ahall@autodist.com</a>> wrote:<br>
> Hello all,<br>
> I'm trying to get stale ticket alerts working, so am using the<br>
> UntouchedInHours condition. I've also tried, in SQL:<br>
> LastUpdated <= '2 days ago'<br>
> and similar searches. Yet, I always get the same number of tickets as I get<br>
> when I leave the date restriction off completely, and UntouchedInHours is<br>
> always giving me tickets opened today.<br>
<br>
</span>I assume you are using rtcrontool. Correct?<br>
<br>
How are you alerting?<br>
<br>
Is the alerting actually "touching" the tickets thus affecting the query?<br>
<br>
You can query the tickets table directly and see the lastupdated<br>
field. See if that field changes how you would expect when you "touch"<br>
or "update" a ticket.<br>
<span class="HOEnZb"><font color="#888888"><br>
-m<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div>Alex Hall<br></div>Automatic Distributors, IT department<br></div><a href="mailto:ahall@autodist.com" target="_blank">ahall@autodist.com</a><br></div></div>
</div>