I’m trying to put together a process that uses the REST API to close requests that have been set to a particular status for a number of days, but I’m having trouble limiting the search to both the status and the date range:
$ cat close_aged_requests.sh #!/bin/bash if [ ! -e cookiejar.txt ] then curl -d "user=efarayenkay&pass=<password" -c cookiejar.txt https://rt.company.com.au > /dev/null fi curl -e https://rt.company.com.au -b cookiejar.txt https://rt.company.com.au/REST/1.0/search/ticket?query="(Status='pendinguser') AND (LastUpdated < '2018-06-22')"
It returned all requests that had ‘pendinguser’ as its status. I assigned one as such this morning but it too appears in this search - indicating to me that it isn’t checking the LastUpdated date.
Am I doing something wrong? Running RT 4.4.1 on OpenBSD 6.1 using OpenBSD’s internal httpd, MariaDB version 10.1.21.