Video Screencast Help

Deleting Tickets In Symantec Service desk 7.1 sp2

Created: 23 Oct 2012 | 5 comments

Hi guys,

I have a small problem we have inbound email monitoring on and now we have few tickets created which shouldn't be there. Is ther any way we can delete them of the database. Any SQL query.

Comments 5 CommentsJump to latest comment

reecardo's picture

The following SQL will completely wipe the DB of processes and tasks in Workflow... SD would require a little bit more

DELETE FROM TaskAssignment


DELETE FROM ReportProcess

You'd have to append some WHERE clauses to narrow down the tickets/processes you're trying to delete.

kareddy's picture

i tried it but not satisfied with results.

i want to keep all the users contacts grouping to previous tickets just delete the email tickets.

jpellet2's picture

Not sure if this is what you're looking for or not but this is the script we use to delete orphaned tickets but have used it elsewhere. You will need to enter the ticket number manually for each one:

-- The following SQL script changes orphan tickets to Closed.

-- Before using, it is recommended to back up the Ensemble database before proceeding.

USE ProcessManager

--Note: Change the 'ReportProcessID' value to the processid (ticket number) you wish to close 
--For example, 'IM-001527'

UPDATE [ProcessManager].[dbo].[ReportProcess]
   SET [Result] = 'Closed'
 WHERE ReportProcessID = 'IM-001527'

UPDATE [ProcessManager].[dbo].[ServiceDeskIncidentManagement]
   SET [close_code] = 'Closed Orphan'
 WHERE Process_ID = 'IM-001527'

 UPDATE [ProcessManager].[dbo].[Task]
   SET [IsCompleted] = '1'
 WHERE WFTaskNumberPrefix = 'IM-001527'

Is there a reason that the tickets simply can't stay there and just be closed?

kareddy's picture

Thanks for the reply jpellet2, but the script you gave just closes the ticket not delet it from the SQL database.

TGiles's picture

If the tickets you are trying to remove are still defined as EM processes & not IM processes you can use the following script below. This script was actually designed to remove a large number of EM tickets

DECLARE @Process_ID nvarchar(50),
@Session_ID nvarchar(36)
SET @Process_ID = 'XX-######'  --Specific Process ID to be deleted.
SET @Session_ID = (SELECT SessionID FROM ReportProcess WHERE ReportProcessID = @Process_ID)
DELETE FROM ReportProcess WHERE SessionID = @Session_ID
DELETE FROM ReportProcessStatusHistory WHERE SessionID = @Session_ID
DELETE FROM Task WHERE SessionID = @Session_ID
DELETE FROM [Messages] WHERE MessageID = @Session_ID
Now if the e-mail has been converted into an actual IM ticket there will be some additional tables that will need to be cleaned up.
I had a similiar script for IM, but I'd have to try and find it again if necessary.