Dear Stefano, first of all, you should consider to subscribe to the ITSM mailing list ;-) where are definitively people using ITSM modules.
ITSM lists: OTRS::ITSM User questions and discussions => http://lists.otrs.org/mailman/listinfo/itsm OTRS::ITSM announcement mailinglist => http://lists.otrs.org/mailman/listinfo/itsm-announce On 02.03.2011, at 10:28, Stefano Boccanera wrote: > I'm testing OTRS ITSM Change Mangement to implement a change management > solution at a italian customer site. Nice, welcome ;-) > Now, after some testing creating change requests, workorders and so on, I > would to clear the configuration without 'dropping' the database and > re-create it from scratch. The problem is around the lack of 'Delete' > function for Change Request items. > I discovered into the bin directory a ITSMChangeDelete.pl module and I'm > wondering if I can use it as a Generic Agent operation. I'm a newbie with > perl language and I have some difficult to read the code and understand how > to use it ( what parameter, etc.). > > Has anyone used that procedure or know some details how to use it? ===> B A S I C S: In most cases you can just execute our perl files and attach a —help (hyphen hyphen help) to get help on how to use the script. E.g. /usr/bin/perl /opt/otrs/bin/otrs.ITSMDeleteChanges.pl —help This actually tells you how to use the script: otrs.ITSMChangeDelete.pl <Revision 1.3> - delete changes (all or by number). Copyright (C) 2001-2011 OTRS AG, http://otrs.org/ Usage: /opt/otrs30itsm/bin/otrs.ITSMChangeDelete.pl [options] Options are as follows: --help display this option help --all delete all changes --ChangeNumber no1 no2 no3 delete listed changes ===> D E T A I L S: You can see that the script does understand 3 options. 1. The help command itself 2. all, to just delete ALL Changes (be careful ;-) 3. dedicated Change numbers Only the 3rd option requires some additional input. If you just want to delete specific Changes, which I would recommend, your command should look similar to this one: E.g. Delete Change 2011012710000015 and 2011012710000016 /usr/bin/perl /opt/otrs/bin/otrs.ITSMDeleteChanges.pl —ChangeNumber 2011012710000015 2011012710000016 ===> G O O D I E S: If you want to delete only Changes in a certain state or with a specific attribute, you need to get these details first by executing a SQL command within a shell script for example, and then attach the resulting Change numbers to the script. You probably will execute the script then in a for-loop to make sure it does not delete more then 200 Changes in a go ... or whatever kind of failure protection ... SQL example to find all Changes in a retracted status: 1. find the “retracted” status id SELECT id FROM general_catalog WHERE general_catalog_class = "ITSM::ChangeManagement::Change::State” AND name = "retracted"; 2. find the relevant Changes SELECT change_number FROM change_item WHERE change_state_id = 133; ===! 133 is the retracted state id in my database Hope that helps ... Cheers, Nils — Nils Leideck http://webint.cryptonode.de / a Fractal project --------------------------------------------------------------------- OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs
