OTRS integration with Bugzilla

English! place to talk about development, programming and coding
Post Reply
vadivel123
Znuny newbie
Posts: 1
Joined: 11 Aug 2012, 10:14
Znuny Version: 3.1.7

OTRS integration with Bugzilla

Post by vadivel123 »

Hi,

I am integeration OTRS with Bugzila.

I am able to create a ticket in OTRS using SOAP.

I am able to create a Bug in Bugzilla using SOAP.

I have issue in locating the place where the ticket is beging created, so that I can use the below mentioned code to create the bug in bugzilla.
=====================
Code: system("/usr/bin/perl /opt/bugzilla/contrib/CreateBug.pl");

============================

I have also tried creating an event, the code is as follows.
===========================
Code:

package Kernel::System::Ticket::Event::Bugzilla;

use strict;
use warnings;

use vars qw($VERSION);
$VERSION = qw($Revision: 1.1 $) [1];

sub new {
my ( $Type, %Param ) = @_;

# allocate new hash for object
my $Self = {};
bless( $Self, $Type );

# get needed objects
for (
qw(
ConfigObject CustomerGroupObject CustomerUserObject DBObject EncodeObject GroupObject
HTMLUtilsObject LinkObject LockObject LogObject LoopProtectionObject MainObject
PriorityObject QueueObject SendmailObject ServiceObject SLAObject StateObject
TicketObject TimeObject TypeObject UserObject ValidObject
)
)
{
$Self->{$_} = $Param{$_} || die "Got no $_!";
}

return $Self;
}

sub Run {
my ( $Self, %Param ) = @_;

# check needed stuff
for (qw(TicketID Event Config)) {
if ( !$Param{$_} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $_!" );
return;
}
}

return 1 if $Param{Event} ne 'TicketCreate';

system("/usr/bin/perl /opt/bugzilla/contrib/CreateBug_Test.pl");
return 1;
}

1;

I have run the code in terminal and it's not giving any output and no error is also displayed.

I have checked the log file and there too no error is shown.

I have configured the config.pm
================================

Code:

$Self->{'Ticket::EventModulePost'}->{'100-Bugzilla'} = {
'Event' => '(TicketCreate)', # Here you register the events you want to listen to
'Module' => 'Kernel::System::Ticket::Event::Bugzilla', # the module that is called for those events
};
================

Sugest me how to create a bug in bugzilla when a ticket is created in OTRS.
root
Administrator
Posts: 4250
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS integration with Bugzilla

Post by root »

You did it right with your eventhandler. But I suggest to decouple it. Write everything you need from otrs into a custom table of the otrs database. Run a cronjob that creates the bugzilla entry. This prevent your OTRS instance from throwing error messages if your Bugzilla has problems. If you're cool use a Message Queue like Apache ActiveMQ instead of a custom table.

hth,
Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
Post Reply