<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Nevermind, I tried this in testing on 4.2 and it didn't fix it.  I was thinking perhaps the human readable parsing was changing how the date was considered, but it doesn't seem to be the case.<div class=""><br class=""></div><div class="">Aaron <br class=""><div><blockquote type="cite" class=""><div class="">On Dec 19, 2016, at 3:16 PM, Aaron McCormack <<a href="mailto:aaron@backblaze.com" class="">aaron@backblaze.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Alex, could it be an accidental reversal of > and < ?<div class=""><div class=""><br class=""></div><div class="">I think LastUpdated >= '3 days ago' is more of the intent because you were surprised of seeing tickets which were updated within the past day.  </div><div class=""><br class=""></div><div class="">Aaron</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Dec 19, 2016, at 12:32 PM, Alex Hall <<a href="mailto:ahall@autodist.com" class="">ahall@autodist.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class="">Well, I found something that works. It's not UntouchedInHours, but this query seems to return what I want:<br class=""><br class=""></div>select id<br class=""></div>from Tickets<br class=""></div>where LastUpdated <= (now() - INTERVAL 10 DAYS);<br class=""><br class=""></div>I still have to work out how to email ticket owners, but at least I can get the right tickets now. Odd that the other way doesn't work. How exactly does this "10 days ago" syntax get interpreted? Or is it no longer supported?<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Dec 19, 2016 at 2:48 PM, Alex Hall <span dir="ltr" class=""><<a href="mailto:ahall@autodist.com" target="_blank" class="">ahall@autodist.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class="">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 class=""><br class=""></div>/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \<br class=""></div>--search-arg "status != 'resolved' and LastUpdated <= '3 days ago'" \<br class=""></div>--action RT::Action \<br class=""></div>--verbose<br class=""><br class=""></div>Or:<br class=""><br class=""></div>/opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \<br class=""></div>--search-arg "status != 'resolved'" \<br class=""></div>--condition RT::Condition::<wbr class="">UntouchedInHours \<br class=""></div>--arg-condition 72 \<br class=""></div>--verbose<br class=""><br class=""></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 class=""><br class=""></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 class=""><br class=""></div>select id, LastUpdated<br class=""></div>from Tickets<br class=""></div>where LastUpdated <= '3 days ago'<br class=""></div>order by LastUpdated DESC<br class=""></div>limit 10;<br class=""><br class=""></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 class=""></div><div class="gmail_extra"><div class=""><div class="h5"><br class=""><div class="gmail_quote">On Mon, Dec 19, 2016 at 2:37 PM, Matt Zagrabelny <span dir="ltr" class=""><<a href="mailto:mzagrabe@d.umn.edu" target="_blank" class="">mzagrabe@d.umn.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alex,<br class="">
<span class=""><br class="">
On Mon, Dec 19, 2016 at 12:54 PM, Alex Hall <<a href="mailto:ahall@autodist.com" target="_blank" class="">ahall@autodist.com</a>> wrote:<br class="">
> Hello all,<br class="">
> I'm trying to get stale ticket alerts working, so am using the<br class="">
> UntouchedInHours condition. I've also tried, in SQL:<br class="">
> LastUpdated <= '2 days ago'<br class="">
> and similar searches. Yet, I always get the same number of tickets as I get<br class="">
> when I leave the date restriction off completely, and UntouchedInHours is<br class="">
> always giving me tickets opened today.<br class="">
<br class="">
</span>I assume you are using rtcrontool. Correct?<br class="">
<br class="">
How are you alerting?<br class="">
<br class="">
Is the alerting actually "touching" the tickets thus affecting the query?<br class="">
<br class="">
You can query the tickets table directly and see the lastupdated<br class="">
field. See if that field changes how you would expect when you "touch"<br class="">
or "update" a ticket.<br class="">
<span class="m_3253852332726521610HOEnZb"><font color="#888888" class=""><br class="">
-m<br class="">
</font></span></blockquote></div><br class=""><br clear="all" class=""><br class=""></div></div><span class="">-- <br class=""><div class="m_3253852332726521610gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div class="">Alex Hall<br class=""></div>Automatic Distributors, IT department<br class=""></div><a href="mailto:ahall@autodist.com" target="_blank" class="">ahall@autodist.com</a><br class=""></div></div>
</span></div>
</blockquote></div><br class=""><br clear="all" class=""><br class="">-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div class="">Alex Hall<br class=""></div>Automatic Distributors, IT department<br class=""></div><a href="mailto:ahall@autodist.com" target="_blank" class="">ahall@autodist.com</a><br class=""></div></div>
</div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>