How to filter Ticket Type for Customer based on groups?

Moderator: crythias

Locked
StefanoBoccanera
Znuny newbie
Posts: 76
Joined: 23 Feb 2011, 15:43
Znuny Version: 3.1.5
Real Name: Stefano Boccanera
Company: I.Conseils (self-employee)
Location: Rome (Italy)

How to filter Ticket Type for Customer based on groups?

Post by StefanoBoccanera »

Hi

I'd like to filter the Ticket Types available to customer (excluding agent) based on customer/group relationship.

I read ACL example in the OTRS manual, but reading following paragraph
In Script 18.1 there is a list of all parameters which can be used for ACLs.

# ticket acl
$Self->{TicketAcl}->{'ACL-Name-Test'} = {
# match properties
Properties => {
# current action match properties
Frontend => {
Action => ['AgentTicketPhone', 'AgentTicketEmail'],
},
# current user match properties
User => {
Group_rw => [
'hotline',
],
},
# current user match properties
Ticket => {
Queue => ['Raw'],
State => ['new', 'open'],
Priority => ['some priority'],
Lock => ['lock'],
CustomerID => ['some id'],
CustomerUserID => ['some id'],
TicketFreeKey1 => ['some key'],
TicketFreeKey2 => ['some key'],
# ...
TicketFreeKey8 => ['some key'],
TicketFreeText1 => ['some value'],
TicketFreeText2 => ['some value'],
# ...
TicketFreeText8 => ['some value'],
}
},
# return possible options (white list)
Possible => {
# possible ticket options (white list)
Ticket => {
Queue => ['Hotline', 'Koordination'],
State => => ['some state'],
Priority => ['5 very high'],
TicketFreeKey1 => ['some key'],
TicketFreeKey2 => ['some key'],
# ...
TicketFreeKey8 => ['some key'],
TicketFreeText1 => ['some value'],
TicketFreeText2 => ['some value'],
# ...
TicketFreeText8 => ['some value'],
},
# possible action options (white list)
Action => {
AgentTicketLock => 1,
AgentTicketZoom => 1,
AgentTicketClose => 1,
AgentTicketPending => 0,
AgentTicketNote => 1,
AgentTicketHistory => 0,
AgentTicketPriority => 1,
AgentTicketFreeText => 0,
AgentTicketHistory => 1,
AgentTicketCompose => 1,
AgentTicketBounce => 1,
AgentTicketTicketPrint => 0,
AgentTicketForward => 1,
AgentTicketTicketLink => 1,
AgentTicketPrint => 1,
AgentTicketPhone => 1,
AgentTicketCustomer => 1,
AgentTicketOwner => 0,
},
},
# remove options (black list)
PossibleNot => {
# possible ticket options (black list)
Ticket => {
Queue => ['Hotline', 'Koordination'],
State => ['closed', 'removed'],
},
},
};

Script 18.1. Valid parameters for ACLs.


sounds like no parameters regarding ticket type and groups are available to build an ACL.

Someone has an example or suggestion how to solv ethe problem?

best regards

stefano
Stefano Boccanera

OTRS : 3.1.5
ITSM : 3.1
S.O : RH
RDBMS : Postgres
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to filter Ticket Type for Customer based on groups?

Post by crythias »

Code: Select all

$Self->{TicketAcl}->{'ACL-something-descriptive'} = 
{
                     # match properties
   Properties => {

       User => {
                Group_rw => [
                    'somegroupname',
                ],
            },
   },

   Possible => {
        Ticket => { Type  => ['typename', ],
                  },
   },
};
try it...
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
StefanoBoccanera
Znuny newbie
Posts: 76
Joined: 23 Feb 2011, 15:43
Znuny Version: 3.1.5
Real Name: Stefano Boccanera
Company: I.Conseils (self-employee)
Location: Rome (Italy)

Re: How to filter Ticket Type for Customer based on groups?

Post by StefanoBoccanera »

Thanks crithyas

I tried , but it doesn't work.

I'm wondering if I didn't explain well my objective:

I have 6 ticket type (say t1 .... t6), any customer is linked to one group (by default) , a customer's subset is also linked to a second group (say g2).

Now I' d like that :

- customer with only default group are restricted to create ticket types t1,t2,t3
- customer with default group and g2 group can use all ticket types: t1...t3 and also t4...t6

Inside the CustomerTicketMessage form, customer would see, and select, only the ticket types according to above rule.

So I'm a bit confused on the OTRS ACL logic because it's not very clear (into your example) if user is not into the g2 group, he/she has not access to t4 ... t6 ticket types (and obviously he/she can't select them in CustomerTicketMessage form).

best regards

stefano
Stefano Boccanera

OTRS : 3.1.5
ITSM : 3.1
S.O : RH
RDBMS : Postgres
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: How to filter Ticket Type for Customer based on groups?

Post by crythias »

StefanoBoccanera wrote:So I'm a bit confused on the OTRS ACL logic because it's not very clear (into your example) if user is not into the g2 group, he/she has not access to t4 ... t6 ticket types (and obviously he/she can't select them in CustomerTicketMessage form).
Are you saying this is your experience based upon the ACL above, or it's your desire or expectation?

Types don't have permissions, so you'll have to think in terms of ACLs with PossibleNots or something.
For all this, you might consider CustomerGroups and SubQueues - The queues already have group permissions.
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
StefanoBoccanera
Znuny newbie
Posts: 76
Joined: 23 Feb 2011, 15:43
Znuny Version: 3.1.5
Real Name: Stefano Boccanera
Company: I.Conseils (self-employee)
Location: Rome (Italy)

Re: How to filter Ticket Type for Customer based on groups?

Post by StefanoBoccanera »

Hi crythias

I tried

I found a solution changing my view. Now I made available to the customers queue selection (but customer view this selection 'like' a simple 'RfC request'. Further I link queue to groups and all
works well, as I expected.

Thanks for your suggestion

stefano
Stefano Boccanera

OTRS : 3.1.5
ITSM : 3.1
S.O : RH
RDBMS : Postgres
lubos
Znuny newbie
Posts: 1
Joined: 11 Dec 2011, 09:35
Znuny Version: 3.0.11

Re: How to filter Ticket Type for Customer based on groups?

Post by lubos »

Hello,

I have the very similar problem.

I have 3 groups: user-incident, user-problem and user-change, and 3 ticket types: Incident, Problem, Change . Now I would like to have displayed only the ticket types according the groups the customer is in. For example: if customer is in groups user-incident and user-change, he will have access to Incident and Change ticket types, if he is in all 3 groups, he will have access to all 3 ticket types, if he is in group user-problem, he has access only to Problem tickets etc.

My two questions to it:

* is there any possibility to resolve this without "converting" ticket types to queues, using the current ACLs (I tried many combinations, but wasn't successful - I also tried the enhanced ACLs in KIX4OTRS, but without success; it seems to me that under any solution I cannot currently check if the user is in 2 or more groups at once, but maybe I'm wrong) ?

* if there will be no other way to set this up using ACLs and I will have to convert ticket types to queues, the requirement is to have correct ticket type assigned to ticket after submitting. My idea is to create GenericAgent which automatically assigns the queue to the particular ticket type, but this GenericAgent will have to be invoked only on demand after ticket submit. Is there any way to do it in OTRS without code changes?

Thanks a lot in advance,

Lubos
Locked