How to reset the IDs of Request, Problem and Change ?

How to reset the IDs of Request, Problem and Change ?

To reset the ID's of the respective module follow the below steps:

1) Connect to the Database

2) Use the update query mentioned below for resetting the ID's :
Note: We highly recommend you to take a trimmed backup of the application before executing the query.
3) Restart the application service and try creating a new ticket to check the ID series.

************************************************************************************************************************

Below is the compatible query for 10.6 version and above :

Reset Request ID 

update seqgenstate set currentbatchend='3500' where seqname='WorkOrder.WORKORDERID';

Post the above query , the request ID's will start from 3500. You can provide your expected number here instead.

Reset Change ID 

update seqgenstate set currentbatchend='value' where seqname='changedetails.changeid';

Replace value [with a number greater than the existing  change id] from which you want the Change ID to start from.

Reset Problem ID 

update seqgenstate set currentbatchend='value' where seqname='Problem.Problemid'; 

Replace value [with a number greater than the existing problem id] from which you want the Problem ID to start from.

************************************************************************************************************************

Below works for 10.5 version ( tested in 10534 )

PGSQL:

 C:\ManageEngine\ServiceDeskPlus-MSP\pgsql\bin> psql.exe -p 65432 -U postgres -d servicedesk

 Queries for the respective modules:

Reset Request ID :

 insert into workorder(workorderid,requesterid,createdtime,respondedtime,duebytime,completedtime,timespentonreq,isparent,is_catalog_template,fr_duetime,haschange,hascausedbychange,hasproblem,surveystatus,hasdraft,resolvedtime) values (3000,1,0,0,0,0,0,true,false,0,false,false,false,0,false,0);

 Reset Problem ID :

 insert into problem (problemid,title,reportedtime,updatedtime,duebytime,closedtime,isread,notespresent) values(3000,’title’,0,0,0,0,false,false);

Reset Change ID :

 insert into changedetails (changeid,title,createdtime,scheduledstarttime,scheduledendtime,completedtime,notespresent) values(3000,’title’,0,0,0,0,false);

 Restart the application service and try creating a new ticket to check the ID series.

************************************************************************************************************************

Note : 

 1. Kindly use only the appropriate query for the desired module.

2. On the above queries, please replace 3000 with ID’s you want to start with. This will create a dummy request in the DB and start from the next ID shown in the UI. In this query, it will start 3001 when a request is created. 

3. Restart the application service and try creating a new ticket to check the ID series.


                    New to ADSelfService Plus?