Assign service to sub-queue

Moderator: crythias

Locked
lando
Znuny newbie
Posts: 12
Joined: 22 Feb 2011, 17:41
Znuny Version: 2.4.7

Assign service to sub-queue

Post by lando »

Hi to all,

I'have an Otrs 2.4.7 installation, in my configuration i configured when the customer open a ticket and a queue is selected, the customer.pl page show only the service that i assign to queue with this script in my Config.pm:

Code: Select all

$Self->{TicketAcl}->{'ACL-Name-4'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^[b]Queue's name[/b]']  },
             },
$Self->{TicketAcl}->
    Possible => {
        Ticket => { Service  => ['[RegExp]::','[RegExp]^[b]Service1[/b]',
                                 '[RegExp]^[b]Service2[/b]',
                                 '[RegExp]^[b]Service3[/b]',
                                 '[RegExp]^[b]Service4[/b]',
                   },
                },
};
But, when the queue specified is an a sub-queue, this script don't work... why?

any idea???

Thanks to all
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: Assign service to sub-queue

Post by Giulio Soleni »

Hi lando,
thank you since you gave me a great hint on how to bind services to queues.
I do not have an answer to your question since I am still not so familiar with ACL definition and I really appreciate if you may give me some further details on your solution...
Anyhow, looking at the code you posted and comparing it to the examples in the manual I found something strange...

1. line 7 - you repeat "$Self->{TicketAcl}->" ... it does not seem correct to me.

2. both in "Properties" and in "Possible" section you make direct reference to the Queue, while I see on the examples that there is always a Ticket in between... i mean, something like:

Code: Select all

$Self->{TicketAcl}->{'ACL-Name-4'} = {
                     # match properties
   Properties => {
      Ticket => {
        Queue => { Name => ['[RegExp]^[b]Queue's name[/b]']  },
       },
   },

...
I do not know if this code would work ... cannot test it right now ... but - again - I really would be glad if we could come to a solution to this topic.
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
lando
Znuny newbie
Posts: 12
Joined: 22 Feb 2011, 17:41
Znuny Version: 2.4.7

Re: Assign service to sub-queue

Post by lando »

Hi giulio,

Meanwhile i worked around this problem, i created only one queue and i linked with ACL to service an sub-service, but now i have another problem with service! :-(

Thanks for the modified code, i will try this modify, i hope will work with sub-queue.

Now if i dont' use a sub-queue, ACL code works fine for 14 queue in my system, but if your service defined are more than 200... i think that there are any problem.... (in this moment i tring to understand if the problem is the number of services => http://forums.otrs.org/viewtopic.php?f=53&t=8414)

thanks :-)
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Assign service to sub-queue

Post by crythias »

By the way, did you try:
Queue::SubQueue

in the Queue Name?
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
sgadow
Znuny newbie
Posts: 11
Joined: 07 Mar 2011, 22:25
Znuny Version: 3.0.6

Re: Assign service to sub-queue

Post by sgadow »

I tried this (to just add the services to the queues) all i did was copied the code replaced the queue/service values into config.pm

and I get the following error.. did i miss a step?

Code: Select all

Software error:

Undefined subroutine &Kernel::Config::Load called at C:/PROGRA~1/OTRS/OTRS//Kernel/Config/Defaults.pm line 2047.
I am using 3.0.6 however if that makes a difference
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: Assign service to sub-queue

Post by Giulio Soleni »

Hi,
maybe I misunderstood the usage of the ACL ... but I've tried this:
defined 4 services: Bronze, Silver, Gold, Platinum
defined some queues (say que1,que2,...)
defined some groups, with a one-to-one relationship for each queue (say grp_que1, grp_que2, ...)
associated all 4 services to one customer (through Service<->Customer)
associated 2 groups (say grp_que3, grp_que5) to one customer.

Then I set the following in Config.pm

Code: Select all

$Self->{TicketAcl}->{'ACL-Name-Test'} = {
	Properties => {
		Ticket => {
			Queue => ['que3'],
		}
	},
	Possible => {
		Ticket => {
			Service  => ['Gold'],
		},
	},
};
Now, when the customer is going to create a new ticket for que3 I expected he could only chose the Gold service... However, once he select the queue he is still allowed to chose from all the services (from Bronze to Platinum).

Do you think there's something missing?

Maybe I misunderstood the usage of ACL's?
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
sgadow
Znuny newbie
Posts: 11
Joined: 07 Mar 2011, 22:25
Znuny Version: 3.0.6

Re: Assign service to sub-queue

Post by sgadow »

Hm ok I tried this and got the opposite.. the services are not available to choose from

Code: Select all

$Self->{TicketAcl}->{'ACL-Customer-Services'} = {
        Properties => {Frontend => {Action => 
['CustomerTicketMessage']},  },
# hide the service's for Queues
       PossibleNot => {Ticket => { Service => 
['[RegExp]::','[RegExp]^*']}  }  };


$Self->{TicketAcl}->{'ACL-Name-1'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^OHS-IT']  },
             },

    PossibleNot => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^Account/Login Issue',
                                 '[RegExp]^Computer Issue',
                                 '[RegExp]^Monitor Issue',
                                 '[RegExp]^Printer Issue',
                                 '[RegExp]^Keyboard/Mouse Issue'],
                         },
                   },
};

$Self->{TicketAcl}->{'ACL-Name-2'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^OHS-Maintnence']  },
             },

    PossibleNot => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^m1',
                                 '[RegExp]^m2',
                                 '[RegExp]^m3',],
                   },
                },
};

$Self->{TicketAcl}->{'ACL-Name-3'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^OHS-Transportation']  },
             },

    PossibleNot => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^t1',
                                 '[RegExp]^t2',
                                 '[RegExp]^t3',],
                   },
                },
};
sgadow
Znuny newbie
Posts: 11
Joined: 07 Mar 2011, 22:25
Znuny Version: 3.0.6

Re: Assign service to sub-queue

Post by sgadow »

Ok well the above will work if you want to not show a service for only particular queues.. which will work just fine I suppose.. however anyone know how it would be changed to do the opposite and show services/queue rather than hide them?
sgadow
Znuny newbie
Posts: 11
Joined: 07 Mar 2011, 22:25
Znuny Version: 3.0.6

Re: Assign service to sub-queue

Post by sgadow »

Ok this works.. try this out

Code: Select all

$Self->{TicketAcl}->{'ACL-Customer-Services'} = {
        Properties => {Frontend => {Action =>
['CustomerTicketMessage']},  },
# Show Services for Queues
       Possible => {Ticket => { Service =>
['[RegExp]::','[RegExp]^*']}  }  };


$Self->{TicketAcl}->{'ACL-Name-1'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^OHS-IT']  },
             },

    Possible => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^Account/Login Issue',
                                 '[RegExp]^Computer Issue',
                                 '[RegExp]^Monitor Issue',
                                 '[RegExp]^Printer Issue',
                                 '[RegExp]^Keyboard/Mouse Issue'],
                         },
                   },
};

$Self->{TicketAcl}->{'ACL-Name-2'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^OHS-Maintnence']  },
             },

    Possible => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^m1',
                                 '[RegExp]^m2',
                                 '[RegExp]^m3',],
                   },
                },
};

$Self->{TicketAcl}->{'ACL-Name-3'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^OHS-Transportation']  },
             },

    Possible => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^t1',
                                 '[RegExp]^t2',
                                 '[RegExp]^t3',],
                   },
                },
};
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: Assign service to sub-queue

Post by Giulio Soleni »

Hi sgadow,
I have tried to adapt your code to my system without result. :(
Please, sorry if my questions sound silly, but I'd really apreciate some other hints from you... in particular:

1. the first 'ACL-Customer-Services' ACL can be taken as-is? I mean is it valid for any generic environment?
I cannot actually understand what is supposed to be used for...

2. Whenever you use the syntax '[RegExp] does it mean that the following string must be considered a regular expression? Is there a specific meaning for '[RegExp]::' ? I guess that '[RegExp]^*' means "every possible string"... is it correct? '[RegExp]^Monitor Issue' means the specific string "Monitor Issue" ?

3. May you please give some more details about your system... the specific queues and service names for which you have implemented the ACL's? I'd like to know what is the exact match with the syntax that you have used on the code and try to make the same in my environment...
For what I may understand you have:
3 Queues:
OHS-IT
OHS-Maintnence
OHS-Transportation

11 services
Account/Login Issue
Computer Issue
Monitor Issue
Printer Issue
Keyboard/Mouse Issue
(belonging to OHS-IT queue)

m1
m2
m3
(belonging to OHS-Maintnence)

t1
t2
t3
(belonging to OHS-Transportation)

... am I correct?

4. I think it's a prerequisite to bind Cusomer<->Services from the admin console to possibly allow any customer to use every possible defined service. Is it correct? Is there any other step needed to be implemented other than setting the Config.pm file accordingly?

Thank you in advance
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
sgadow
Znuny newbie
Posts: 11
Joined: 07 Mar 2011, 22:25
Znuny Version: 3.0.6

Re: Assign service to sub-queue

Post by sgadow »

Keep in mind It takes time for your config to update automatically after changes (make sure you are refreshing your page and/or clearing cache)

the ACL-Customer-Services can stay just as it is..

This is working on a fresh install 3.0.6 (i can't see why it wouldn't work with older versions as well) with no other mods/addons and this is the only code i changed anywhere.. added the services and the queues (the m1 etc.. services are just placeholders I have no real service associated with them as of yet) the services can be added and/or joined to the customers before or after the code is in the system it don't matter which order but it does need to be done..

as far as regexp goes and its usage in the code this may help you understand it better

http://www.cs.tut.fi/~jkorpela/perl/regexp.html
sgadow
Znuny newbie
Posts: 11
Joined: 07 Mar 2011, 22:25
Znuny Version: 3.0.6

Re: Assign service to sub-queue

Post by sgadow »

To add.. I have however noticed that when i switch say from the default selection which is - to the OHS-IT queue the list displays correctly however if i switch to a queue that is not in my code fex Postmaster all services show.. then if i switch from there to say OHS-IT then all services still show.. but if i switch back to - then back to OHS-IT it is correct again..

It is really touchy with things.. make sure all of your queues and services are listed in your code that you currently have in the system.. if there are any left out I believe that is causing some issues on my end.. I have not completely added everything to see if that fixes the issue with the services refreshing correctly.. when I do get them added I will update with whether or not it fixes the issue..

Edit: Ok that did not fix the issue and i'm perplexed so i resorted back to my original which was exclusion rather than inclusion.. in my case that works fine it may for you as well
Giulio Soleni
Znuny wizard
Posts: 392
Joined: 30 Dec 2010, 14:35
Znuny Version: 6.0.x and 5.0.x
Real Name: Giulio Soleni
Company: IKS srl

Re: Assign service to sub-queue

Post by Giulio Soleni »

just a follow up to say that now everything seems finally to work for me :D.
Here is my piece of code:

Code: Select all

$Self->{TicketAcl}->{'ACL-Customer-Services'} = {
        Properties => {Frontend => {Action =>
['CustomerTicketMessage']},  },
# Show Services for Queues
       Possible => {Ticket => { Service =>
['[RegExp]::','[RegExp]^*']}  }  };

$Self->{TicketAcl}->{'ACL-Name-1'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^Internal Usage']  },
             },

    Possible => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^Gold',
                                 '[RegExp]^Bronze',],
                         },
                   },
};
$Self->{TicketAcl}->{'ACL-Name-2'} = {
                     # match properties
   Properties => {

        Queue => { Name => ['[RegExp]^Xportal']  },
             },

    Possible => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^Gold',
                                 '[RegExp]^Platinum',],
                         },
                   },
};
$Self->{TicketAcl}->{'ACL-Name-3'} = {
                     # match properties
   Properties => {
	# NOTE THE SYNTAX FOR SUBQUEUES
        Queue => { Name => ['[RegExp]^Security::Networking']  },
             },

    Possible => {
        Ticket => { Service  => ['[RegExp]::',
                                 '[RegExp]^Gold',
                                 '[RegExp]^Silver',],
                         },
                   },
};
I have defined 4 services (Bronze, Silver, Gold, Platinum) with their corresponding SLAs.
With the settings above on the Customer console all my queue presents as a default all the 4 Services,
Internal Usage queue shows only Gold and Bronze
Xportal queue shows only Gold and Platinum
Security::Networking (Networking is a subqueue of Security) shows only Gold and Silver

I tested also the case if a customer does not have all services mapped, for example let's say custom1 can is mapped to all services, but "Silver" and the system replies as expected: Security::Networking for custom1 shows only Gold service.

That's all, if this was a thread of mine I'd set it SOLVED.
I'd like to thank you all of you for your hints and time.
OTRS 6.0.x on CentOS 7.x with MariaDB 10.2.x database connected to an Active Directory for Agents and Customers.
ITSM and FAQ modules installed.
Locked