The question came up how to set an Archive and Purge Rule for a specific ticket in CA ITSM.
It was an unusual request, because you don't normally need to remove single tickets, but was needed because this ticket had an inordinately high number of Attached Events to it for some reason.
Still, it illustrates the use of the "Additional Query" function within Archive and Purge. This feature allows a great deal of flexibility in removing records, and this is a simple example.
Note that it is better to Archive and Purge a troublesome record, as it removes all of the related records. Just removing it only from the Call_Req table via database commands is bad practice, as it leaves orphaned data in other tables.
Additional Query Example
For the Call Request with a ticket number of "24" (as seen through the interface), the Additional Query code is:
ref_num = \'24\'
Note that you need to escape the single quotes with a backslash.
After running, the above example left this 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
In order to make this work, all of the normal rules of Archive and Purge apply. It is also best to test rules (a) on a test server and (b) in "Archive Only" mode until confirmed that they work.
If your query does not work, then check items such as:
pdm_logstat -n arcpur_srvr TRACE
and turn off when done with:
pdm_logstat -n arcpur_srvr
I think this document should replace this tech doc: TEC477556 which in my opinion has a slight flaw as it leaves several tables, e.g. act_log orphaned if you consider that the method described does not cater for linked tables and thus breaks referential integrity.
I've updated the original TEC document to the new KB format with some minor changes from this thread and issues here:
How to Archive and Purge a specific ticket, in Ser - CA Knowledge
Thanks Brian - gave me a morning's work. :-)
I've retired TEC477556 and published a new document TEC1287591 with the above steps.
TEC1287591 How to Archive and Purge a specific ticket, in Service Desk Manager.
Great article for introduction to archive and purge functionality!
On a side note for the use case presented.
You may want to point out that only inactive tickets are purged out. Meaning you first have to close this ticket before been able to purge it.
Closing the ticket isn't either supposed to detach all the associated events(at less for service type events) either if I know that you may time to time want to keep events on closed ticket.
My 2 cents