
Hi all, I have a question about RegExp in ACL's We have several mail accounts, each one going to a different Raw queue (let's say a.otrs@xxx goes to a.raw, b.otrs@xxx goes to b.raw) there is a first level for each of these raw accounts (queues a.first_level and b.first_level) and then a second level, common to all of them (queue second_level). Is it possible, using RegExp in ACL, to capture the first part of the Raw queue so we can set "Possible actions" to its first level queue? In perl, I would do something like Properties => { Queue => { Name => ['[RegExp]^(.*)\.Raw'], } }, Possible => { # possible ticket options Ticket => { Queue => ['$1.first_level'], }, } Kind regards, Juan Clavero

Hi Juan, as far as I know the RegExp is just for matching. In Ticket.pm's TicketACL subroutine you can see multiple points where RegExp is used to match values. If stored, the $1 variable would be available just in that scope, not further. The part where "Possible" values are collected is way further below, so $1 wouldn't be available there any more... Sorry for not having better news, kind regards, Johannes Hoerburger -- Custom Engineering OTRS AG Europaring 4 D-94315 Straubing Am 30.10.2012 um 10:45 schrieb Juan Manuel Clavero Almirón:
Hi all, I have a question about RegExp in ACL's We have several mail accounts, each one going to a different Raw queue (let's say a.otrs@xxx goes to a.raw, b.otrs@xxx goes to b.raw) there is a first level for each of these raw accounts (queues a.first_level and b.first_level) and then a second level, common to all of them (queue second_level).
Is it possible, using RegExp in ACL, to capture the first part of the Raw queue so we can set "Possible actions" to its first level queue?
In perl, I would do something like Properties => { Queue => { Name => ['[RegExp]^(.*)\.Raw'], } }, Possible => { # possible ticket options Ticket => { Queue => ['$1.first_level'], }, }
Kind regards, Juan Clavero
--------------------------------------------------------------------- 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

JMCA: let's say a.otrs@xxx goes to a.raw, b.otrs@xxx goes to b.raw
Why use a postmaster filter for that? Why not use the dispatch on TO: ? On Tue, Oct 30, 2012 at 5:56 AM, Johannes Hoerburger < johannes.hoerburger@otrs.com> wrote:
Hi Juan, as far as I know the RegExp is just for matching.
In Ticket.pm's TicketACL subroutine you can see multiple points where RegExp is used to match values.
If stored, the $1 variable would be available just in that scope, not further.
The part where "Possible" values are collected is way further below, so $1 wouldn't be available there any more...
Sorry for not having better news, kind regards, Johannes Hoerburger
-- Custom Engineering
OTRS AG Europaring 4 D-94315 Straubing
Am 30.10.2012 um 10:45 schrieb Juan Manuel Clavero Almirón:
Hi all, I have a question about RegExp in ACL's We have several mail accounts, each one going to a different Raw queue (let's say a.otrs@xxx goes to a.raw, b.otrs@xxx goes to b.raw) there is a first level for each of these raw accounts (queues a.first_level and b.first_level) and then a second level, common to all of them (queue second_level).
Is it possible, using RegExp in ACL, to capture the first part of the Raw queue so we can set "Possible actions" to its first level queue?
In perl, I would do something like Properties => { Queue => { Name => ['[RegExp]^(.*)\.Raw'], } }, Possible => { # possible ticket options Ticket => { Queue => ['$1.first_level'], }, }
Kind regards, Juan Clavero
--------------------------------------------------------------------- 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
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

GY: In fact, I'm not using Postmaster filter: the problem is that tickets in each RAW queue can move only to a specific queue, and I wanted to save me the boredom of writing several times the same ACL... JH: Good point... so what I did, funnier than writing several times the same ACL, was to take the matching code in Postmaster Filter pm and put it in TicketAcl! It's a quick and non really tested mod, over Ticket.pm (v 1.549.2.8 2012/07/02) diff Kernel/System/Ticket.pm Ticket.pm 5c5 < # $Id: Ticket.pm,v 1.549.2.8 2012/07/02 07:37:10 mh Exp $ --- > # $Id_Old: Ticket.pm,v 1.549.2.8 2012/07/02 07:37:10 mh Exp $ 7094a7095,7100 > > #################### > ## MatchingRegExp ## > #################### > my $Matched = ''; > #################### 7123a7130,7136 > #################### > ## MatchingRegExp ## > #################### > if ($1) { > $Matched = $1; > } > #################### 7131a7145,7151 > #################### > ## MatchingRegExp ## > #################### > if ($1) { > $Matched = $1; > } > #################### 7153a7174,7180 > #################### > ## MatchingRegExp ## > #################### > if ($1) { > $Matched = $1; > } > #################### 7160a7188,7194 > #################### > ## MatchingRegExp ## > #################### > if ($1) { > $Matched = $1; > } > #################### 7286a7321,7326 > #################### > ## MatchingRegExp ## > #################### > $New =~ s/\[\*\*\*\]/$Matched/; > #################### > Kind regards, Juan Clavero -----Mensaje original----- De: Gerald Young[mailto: crythias@gmail.com] Enviado el: martes, 30 de octubre de 2012 14:17 Para: User questions and discussions about OTRS. Asunto: Re: [otrs] RegExp in ACL
JMCA: let's say a.otrs at xxx goes to a.raw, b.otrs at xxx goes to b.raw
Why use a postmaster filter for that? Why not use the dispatch on TO: ? On Tue, Oct 30, 2012 at 5:56 AM, Johannes Hoerburger < johannes.hoerburger at otrs.com> wrote:
Hi Juan, as far as I know the RegExp is just for matching.
In Ticket.pm's TicketACL subroutine you can see multiple points where RegExp is used to match values.
If stored, the $1 variable would be available just in that scope, not further.
The part where "Possible" values are collected is way further below, so $1 wouldn't be available there any more...
Sorry for not having better news, kind regards, Johannes Hoerburger
-- Custom Engineering
OTRS AG Europaring 4 D-94315 Straubing
Am 30.10.2012 um 10:45 schrieb Juan Manuel Clavero Almirón:
Hi all, I have a question about RegExp in ACL's We have several mail accounts, each one going to a different Raw queue (let's say a.otrs at xxx goes to a.raw, b.otrs at xxx goes to b.raw) there is a first level for each of these raw accounts (queues a.first_level and b.first_level) and then a second level, common to all of them (queue second_level).
Is it possible, using RegExp in ACL, to capture the first part of the Raw queue so we can set "Possible actions" to its first level queue?
In perl, I would do something like Properties => { Queue => { Name => ['[RegExp]^(.*)\.Raw'], } }, Possible => { # possible ticket options Ticket => { Queue => ['$1.first_level'], }, }
Kind regards, Juan Clavero
participants (3)
-
Gerald Young
-
Johannes Hoerburger
-
Juan Manuel Clavero Almirón