How to Archive and Purge a specific ticket, in Service Desk Manager.

Document ID : KB000010666
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

The Archive and Purge functionality may be refined to act on specific records in a table, by the use of a SQL "Additional Query." 

 

By default, the Archive and Purge Rules apply to all of the records within a table that meet the general conditions.

 

Sometimes it is needed to remove a specific record from the Service Desk Manager installation. Or it may be needed to remove a range of records.

 

We shall look at the simplest example of removing a single specific ticket from the system.

 

 

Background:

Best practice recommends the use of Archive and Purge, as this not only removes the record from the primary ticket table, but removes entries from related tables - such as the Activity Log table.

 

Removing data only from the primary table will leave orphaned entries in the other tables. It should be avoided as general practice.

Orphaned entries typically do no harm, but do consume a small amount of database space per entry. Worse, they may prove confusing to those who need to examine the data at a later date, such as by reporting.

 

Some examples where it may be required to refine the Archive and Purge Rule:

 

  • Remove a specific ticket
  • Remove a range of tickets
  • Remove tickets by Organization, Location or other criteria

 

Scenario: Remove Call Request "24."

Call Request "24" has been identified as a ticket that should never have entered the system.

It was created in error by an automated process, and contains Events that if fired would result in incorrect notifications being sent.

An Analyst has already taken action and "Closed" this ticket to prevent it firing any Events.

The Administrator now wishes to remove the ticket completely, to prevent it being reopened by accident.

 

Environment:
Any CA Service Desk Manager installation on any platform.This process is performed entirely via the web client interface.No recycle is needed.
Instructions:

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.

 

 

 

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.

 

 

 

 

Additional Information: