1) From the Administrator tab, Archive and Purge, Archive and Purge Rules.
2) "Create New" and complete the standard Archive and Purge fields.
3) Add the Additional Query code to specify the specific ticket, of Call Request "24."
ref_num = \'24\'
Single quotes are needed to escape the backslashes.
Note that the ticket number "24" is the Call Request number as seen through the web client interface. In this example are using ref_num, although you may use the "id" or any other criteria that enables you to uniquely identify the ticket.
After one day passed, this example rule was run and wrote one line in the arcpur.log.0 file:
11/23/2017 10:17:30, One_Call_Req_ONLY, cr, 24, archive and purge, C:\PROGRA~2\CA\SERVIC~1\site\data\archive\20171123T1017_One_CR
Basic Troubleshooting of Archive and Purge
All of the normal rules of Archive and Purge must be satisfied for this example to run.
It is best practice to test new rules to confirm they work:
- On a test server
- In "Archive Only" mode until confirmed that they work.
If your query does not work, then check items such as:
- The Object Name is right - Call Request rather than Incident, for example.
- The Rule is set to run within a valid Schedule - A weekend only schedule won't let a rule run on Monday.
- The Days Inactive has passed - You may reset the server time on a test server to test. Do not do this on production.
- The ticket is Inactive as well as Closed.
- Check there are no errors in the stdlog or the archive log.
- Make sure that the ticket is not a Template.
- Check that all related information such as Child/Parent tickets or related tickets are Closed.
- Check that all Workflows on the ticket are completed.
- Remember that large Archive and Purge operations will take some time to run. Distinguish between the scenarios of "Running, but taking time" against "Not working" from the interface and logs.
If more details are needed, put on this tracing and examine the stdlog again after re-running the rule:
pdm_logstat -n arcpur_srvr TRACE
and turn off when done with:
pdm_logstat -n arcpur_srvr
It is best to start with a simple Additional Query Rule, test that each part works in isolation, and build more complex queries from their parts.
Used in this way, almost any Archive and Purge requirement may be met.