How to delete changes & change Change count

Moderator: crythias

Post Reply
DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

How to delete changes & change Change count

Post by DCO »

Hello Team,

Q-1) How we can delete old change records from the system, from generic agent i am able to delete tickets but not changes.

Q-2) How to modify change counter, right now its either using Date or Datesum which both are too long. We need something like Ticket numbers Such as Change # 100020

Thanks,
Ravi

jojo
Moderator
Posts: 14635
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: How to delete changes & change Change count

Post by jojo »

Q 1) have a look in OTRS bin directory

Q 2) will need development
"Production": OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com :: Share your ideas

DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

Re: How to delete changes & change Change count

Post by DCO »

jojo wrote:Q 1) have a look in OTRS bin directory

Q 2) will need development

Hi Thanks for the Reply!

Regarding Q-1) i can find ITSMChangeDelete.pl in the bin directory, but sorry i am new to OTRS. Could you let me know how we can enable the change delete options using this perl scrip?

Regarding Q-2) Could you please Explain in details.

Regards

EXG133
OTRS superhero
Posts: 217
Joined: 06 Aug 2012, 18:12
OTRS Version?: 3.1.7 & 4.04

Re: How to delete changes & change Change count

Post by EXG133 »

1) Run the perl script with -help (works with most scripts)
You will notice that this script is limited, so maybe use SQL first to get all the specific changenumbers you want (eg all closed changes from before a certain date)

2) You will need to modify the code. See this for an example for incidents: viewtopic.php?f=61&t=7033 , I'm not sure how Changes are generated.

DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

Re: How to delete changes & change Change count

Post by DCO »

Thanks, I have the list of changes. How do i run perl scrip on windows platform?

CSL
OTRS wizard
Posts: 159
Joined: 11 Nov 2011, 19:27
OTRS Version?: 3.0.11

Re: How to delete changes & change Change count

Post by CSL »

the same as you would on Linux:

perl ITSMChangeDelete.pl

if the perl command isn't path'd (if you open up cmd and type 'perl -v' and it can't find the command) you will have to cd to the perl bin directory where the perl executable is, and then run it from there with the full path to the perl script.
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL

DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

Re: How to delete changes & change Change count

Post by DCO »

Hello,

Thanks for the reply.

My Delete perl executive is under below path.

C:\Program Files\OTRS\OTRS\bin hence i gave below command to delete changes.

C:\Program Files\OTRS\OTRS\bin>otrs.ITSMDeleteChanges.pl -ChangeNumber 20120924000001 but i received error saying "its on recognized as internal or external command operatable program or batch file"

Please advice Thanks!

jojo
Moderator
Posts: 14635
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: How to delete changes & change Change count

Post by jojo »

try

perl otrs.ITSMDeleteChanges.pl -ChangeNumber 20120924000001
"Production": OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com :: Share your ideas

DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

Re: How to delete changes & change Change count

Post by DCO »

now its saying

can not open perl scrip otrs.ITSMDeleteChanges.pl - no such file or directory

DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

Re: How to delete changes & change Change count

Post by DCO »

and path is 100% correct.

Do i need to install any perl software to execute this perl scrip ?

DCO
OTRS newbie
Posts: 28
Joined: 18 Sep 2012, 10:05
OTRS Version?: 3.1.10
Real Name: DCO
Company: EGOV

Re: How to delete changes & change Change count

Post by DCO »

When i try to open otrs.ITSMChangeDelete.pl its gives me below error

otrs.ITSMChangeDelete.pl is not valid win32 application

What is wrong here? can i copy paste the same file from other user?

Thanks

CSL
OTRS wizard
Posts: 159
Joined: 11 Nov 2011, 19:27
OTRS Version?: 3.0.11

Re: How to delete changes & change Change count

Post by CSL »

You need to run the perl.exe file, which is not in the OTRS bin directory. On my windows VM it is located here:
C:\Program Files\OTRS\StrawberryPerl\perl\bin\perl.exe

And the file script you want to run is:
C:\Program Files\OTRS\OTRS\bin\otrs.ITSMDeleteChanges.pl

Along with the command line arguments:
-ChangeNumber 20120924000001

So putting that all together, you need to run:

C:\Program Files\OTRS\StrawberryPerl\perl\bin\perl.exe C:\Program Files\OTRS\OTRS\bin\otrs.ITSMDeleteChanges.pl -ChangeNumber 20120924000001

This is an unwieldy command. You can shorten it by changing directory to where the perl.exe file is, and running from there:

cd C:\Program Files\OTRS\StrawberryPerl\perl\bin\

perl.exe C:\Program Files\OTRS\OTRS\bin>otrs.ITSMDeleteChanges.pl -ChangeNumber 20120924000001

If you add the location of perl.exe to your path (google if you're not sure what this is) then you won't have to always go to the location of the perl.exe file in order to run perl scripts.
Backend: OTRS 3.0.11 RedHat Enterprise Linux 6.2, Apache, MySQL with replication
Frontend: OTRS 3.0.11 RedHat Enterprise Linux 6.2 with SELinux, Apache SSL

Post Reply