[SOLVED]Adding Custom PostMaster Filters (Bugzilla Link)

Moderator: crythias

Locked
Waltero
Znuny newbie
Posts: 18
Joined: 16 Dec 2010, 18:14
Znuny Version: 2.4

[SOLVED]Adding Custom PostMaster Filters (Bugzilla Link)

Post by Waltero »

Hi All,

First a bit of background... I'm trying to link OTRS with Bugzilla using the Email interfaces of each. I have setup bugzilla to open a Bug on recipt of an email using the @ tags of its email interface and OTRS response templates. I can also update that bug and change the priority etc using the same method. What i'm trying to do now is have bugzilla update OTRS using the Postmaster filters. More info here for those interested -> http://www.bugzilla.org/docs/3.0/html/api/email_in.html

So...When bugzilla sends out bugs mails it uses custom headers like the ones below:


Subject: [Bug 15458] Re: [Ticket#2010120110000063]Testing Bugz link
implementing
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Sysadmin
X-Bugzilla-Component: Email
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: someon@company.co.uk
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: sysadmins@company.co.uk
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: Status Resolution


Can I get OTRS to look for these headers and update the OTRS ticket accordingly. so for example The developer closes the ticket in bugzilla, bugzilla sends out an email to OTRS which closes the ticket in OTRS.

Alos just to check that i have got my assumptions correct: Am i correct in thinking that The "filter conditions" are what OTRS will search for and the "set email headers" are what OTRS will change in the ticket if the filder conditions are met?

I'm using OTRS 3.0.5

Many thanks in advance for your help. :)
Last edited by Waltero on 25 Feb 2011, 13:05, edited 1 time in total.
Production OTRS: 2.4.7 + ITSM pack
Test OTRS: 3.0.9
MySQL DB
Linux
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding Custom PostMaster Filters (Bugzilla Link)

Post by crythias »

There doesn't seem to be a reason why you cannot add bugzilla headers to OTRS. Search sysconfig for the x-otrs- headers. You'll then match x-bugzilla-something and set x-otrs-something.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Waltero
Znuny newbie
Posts: 18
Joined: 16 Dec 2010, 18:14
Znuny Version: 2.4

Re: Adding Custom PostMaster Filters (Bugzilla Link)

Post by Waltero »

Thanks Crythias. I've added the custom headers now but i'm still struggling to get fields to update in OTRS using the headers.

An example filter below:
Condition:
X-Bugzilla-Status RESOLVED
X-OTRS-State: Closed Succesful

I'm trying to get OTRS to close the ticket when the bugzilla is resolved. I'm also trying to get things like priority updates and owner updates in bugzilla copied across to OTRS.

Thanks again,
W
Production OTRS: 2.4.7 + ITSM pack
Test OTRS: 3.0.9
MySQL DB
Linux
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Adding Custom PostMaster Filters (Bugzilla Link)

Post by crythias »

You should be able to Postmaster Filter

Match X-Bugzilla-Status RESOLVED
Set X-OTRS-State: closed successful

watch case and spelling. also check the System Log for actions.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Waltero
Znuny newbie
Posts: 18
Joined: 16 Dec 2010, 18:14
Znuny Version: 2.4

Re: Adding Custom PostMaster Filters (Bugzilla Link)

Post by Waltero »

Hey,

Ok so according the logs it seems to be working...

Mon Feb 14 14:53:03 2011 notice OTRS-PostMasterMailbox.pl-10 POP3: Fetched 1 email(s) from otrsupdate/mail0.xxxxx.com.
Mon Feb 14 14:53:02 2011 notice OTRS-PostMasterMailbox.pl-10 FollowUp Article to Ticket [2011021410000011] created (TicketID=19, ArticleID=66). ,
Mon Feb 14 14:53:02 2011 notice OTRS-PostMasterMailbox.pl-10 Filter: 'Resolved test' Set param 'X-OTRS-State' to 'closed successful' (Message-ID: <20110214145219.B6E981FD37@xxxxx.com>)
Mon Feb 14 14:53:02 2011 notice OTRS-PostMasterMailbox.pl-10 Filter: 'Bugzilla update Priority P4' Set param 'X-OTRS-Priority' to '4 low' (Message-ID: <20110214145219.B6E981FD37@xxxx.com>)

but these actions aren't having any affect on the ticket. The state is still showing as Open and the priority is still 3!

Any ideas?

Thanks again!,
W
Production OTRS: 2.4.7 + ITSM pack
Test OTRS: 3.0.9
MySQL DB
Linux
Waltero
Znuny newbie
Posts: 18
Joined: 16 Dec 2010, 18:14
Znuny Version: 2.4

Re: Adding Custom PostMaster Filters (Bugzilla Link)

Post by Waltero »

I managed to get this one sorted by setting the X-OTRS-FollowUp-xxxx headers rather than the X-OTRS headers.
:)
Production OTRS: 2.4.7 + ITSM pack
Test OTRS: 3.0.9
MySQL DB
Linux
Locked