[WorkAround] Too Many Customers Displayed to Link to Service

Moderator: crythias

Locked
adupre01
Znuny newbie
Posts: 73
Joined: 09 Jun 2011, 18:22
Znuny Version: 3.0
Real Name: Andre
Company: Hamline University

[WorkAround] Too Many Customers Displayed to Link to Service

Post by adupre01 »

Hey all,

I'm hoping I am just being a newbie but I am having trouble linking all of our customers to our services. We have hundreds of customers in our database (LDAP actually) and when I go to the screen to link the customers with the services there are simply too many customers to be displayed on the screen. This means that not all customers are being assigned to the services we want to them to be. Since there are so many customer users it is really not an option to go through and link them all manually given the number of services we have.

I tried setting the CustomerUserSearchListLimit in the config file higher but this only seems to be for when searching by the customer tab.

I've also looked around a little bit in the sysconfig but could only find a way to change how many customers are displayed by autocomplete on ticket creation (found in Frontend::Agent::CustomerSearch).

Any ideas?
Last edited by adupre01 on 15 Nov 2011, 19:27, edited 1 time in total.
OTRS 3.1.3 + ITSM 3.1.1 + FAQ 2.1.2 + Survey 2.1.3, Redhat
jreno
Znuny newbie
Posts: 34
Joined: 20 Jul 2011, 15:15
Znuny Version: 3.0.10
Real Name: Peter Miller
Company: PC

Re: Link Services to Customers - too many customers displaye

Post by jreno »

Hi,
I am looking for the same thing.
We have got about 1500 customers and about 100 Services divided into about 10 Customer sites.

There must be a CLI solution, unfortunately I couldnt find any otrs* script in the bin directory.

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

Re: Link Services to Customers - too many customers displaye

Post by crythias »

There's a search box on the left (choose the service to assign), so you can certainly limit your results that way.
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
jreno
Znuny newbie
Posts: 34
Joined: 20 Jul 2011, 15:15
Znuny Version: 3.0.10
Real Name: Peter Miller
Company: PC

Re: Link Services to Customers - too many customers displaye

Post by jreno »

@adupre01

"SearchLimit =" is defined in several pm Files, just grep for the occurances.

@crythias
This helps nothing if you want to assign - not display, lets say: 200 users to 20 services. If so, let me know how.

BTW is there a CLI solution for this, I have got 2 text files, one for users, the other for services.
So how to do the Perl Magics?
--
OTRS 3.0.10 running on Debian Squeeze || Serving 600 users / 20 queues / 10 companies
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

Sure. it's not super fun, but it's not incredibly tedious, depending on what you choose for your search criteria.

Admin, Customer <-> Services
Choose your service you want to apply.
search for something that makes sense for your search criteria. If it's per domain, *domain.com* ... if it's somewhat random, at least you can minimize the total number of people shown in this manner, but in any case, click, click, click, click or (assign to all) and submit.
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
jreno
Znuny newbie
Posts: 34
Joined: 20 Jul 2011, 15:15
Znuny Version: 3.0.10
Real Name: Peter Miller
Company: PC

Re: Link Services to Customers - too many customers displaye

Post by jreno »

@crythias
As soon as you click a Customer or Service, the FILTER-Box is nulled.

100 Users x 20 Services result in:
Ca. 20 clicks on 100 Users, or 100 clicks on 20 Services or 20x Enter a search criteria.
Just to let you know, our customers have the same Email-Domain, but belong to DISTINCT companies, with various SLA/Services. :)

OTRS is great but this type of configuration is a NO-GO in 21st century, or you need to script (need for a programmer --> no GUI configuration).
--
OTRS 3.0.10 running on Debian Squeeze || Serving 600 users / 20 queues / 10 companies
adupre01
Znuny newbie
Posts: 73
Joined: 09 Jun 2011, 18:22
Znuny Version: 3.0
Real Name: Andre
Company: Hamline University

Re: Link Services to Customers - too many customers displaye

Post by adupre01 »

Dido for me jreno.

I am setting up OTRS for our university IT. We support hundreds of staff and faculty and several thousand students.

So the problem is that all of our "customers" are from our own university and so everyone has same domain. I suppose I could try searching alphabetically but if I dd "a" "b" "c" OTRS still pulls up people in alphabetical order and misses a lot of users. I could do "aa" "ab" "ac" but this does get tedious since we have more than 20 services. But tedium is not my main concern, what I am concerned about is missing users in assigning services.

Is there not a simple way to assign services to all customers or to groups of customers? Assigning services to groups of customers would be ideal.
OTRS 3.1.3 + ITSM 3.1.1 + FAQ 2.1.2 + Survey 2.1.3, Redhat
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

jreno: what version are you using?

adupre01: Yes, default services.
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
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

This code is based upon otrs.AddUser2Group.pl
call it "AddUser2Service.pl" and stick it in bin

Code: Select all

#!/usr/bin/perl -w

use strict;
use warnings;

use File::Basename;
use FindBin qw($RealBin);
use lib dirname($RealBin);

use Kernel::Config;
use Kernel::System::Encode;
use Kernel::System::Log;
use Kernel::System::Time;
use Kernel::System::DB;
use Kernel::System::Main;
use Kernel::System::User;
use Kernel::System::Service;
use Kernel::System::CustomerUser;

my %Param;
my %CommonObject;
my %Opts;

use Getopt::Std;
getopt( 'suh', \%Opts );

if ( $Opts{h} || !$Opts{s} || !$Opts{u} ) {
    print STDERR
        "Usage: bin/AddUser2Service.pl -s servicename -u username \n";
    exit;
}

# create common objects
$CommonObject{ConfigObject} = Kernel::Config->new(%CommonObject);
$CommonObject{EncodeObject} = Kernel::System::Encode->new(%CommonObject);
$CommonObject{LogObject}    = Kernel::System::Log->new(
    LogPrefix => 'crythias.AddUser2Service',
    %CommonObject,
);
$CommonObject{TimeObject}  = Kernel::System::Time->new(%CommonObject);
$CommonObject{MainObject}  = Kernel::System::Main->new(%CommonObject);
$CommonObject{DBObject}    = Kernel::System::DB->new(%CommonObject);
$CommonObject{CustomerUserObject}  = Kernel::System::CustomerUser->new(%CommonObject);
$CommonObject{ServiceObject} = Kernel::System::Service->new(%CommonObject);

# user id
$Param{UserID} = '1';

# valid id
$Param{ValidID} = '1';
$Param{Active} = '1';
$Param{CustomerUserLogin}        = $Opts{u};
$Param{Name}                  = $Opts{s};

unless (
    $Param{CUID}
    =
    $CommonObject{CustomerUserObject}->CustomerUserDataGet( User => $Param{CustomerUserLogin} )
    )
{
    print STDERR "ERROR: Failed to get Customer User info. Perhaps non-existent customer..\n";
    exit 1;
}

unless ( $Param{ServiceID} = $CommonObject{ServiceObject}->ServiceLookup(%Param) ) {
    print STDERR
        "ERROR: Failed to get Service ID. Perhaps non-existent service..\n";
    exit;
}

print "SID: $Param{Name}/$Param{ServiceID} \n";
print "UID: $Param{CustomerUserLogin}/$Param{UserID} \n";

if ( !$CommonObject{ServiceObject}->CustomerUserServiceMemberAdd(%Param) ) {
    print STDERR "ERROR: Can't add user to service\n";
    exit 1;
}
else {
    exit(0);
}
in excel (for instance), you will need login names and service names.
bin/AddUser2Service.pl -s servicename -u customerlogin

but, there you go. No warranty, your results may vary, subservices are service::subservice.
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
adupre01
Znuny newbie
Posts: 73
Joined: 09 Jun 2011, 18:22
Znuny Version: 3.0
Real Name: Andre
Company: Hamline University

Re: Link Services to Customers - too many customers displaye

Post by adupre01 »

Sorry, I've looked around in the OTRS admin and ITSM manuals... where exactly do I specify which services are available by default? And just to make sure, this marks that service as available to every customer, correct?
OTRS 3.1.3 + ITSM 3.1.1 + FAQ 2.1.2 + Survey 2.1.3, Redhat
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

adupre01 wrote:where exactly do I specify which services are available by default
Admin, Customers <-> Services
Edit Default Services
adupre01 wrote:And just to make sure, this marks that service as available to every customer, correct?
Yes.
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
adupre01
Znuny newbie
Posts: 73
Joined: 09 Jun 2011, 18:22
Znuny Version: 3.0
Real Name: Andre
Company: Hamline University

Re: Link Services to Customers - too many customers displaye

Post by adupre01 »

*face palm*

err... can't beleive I didn't see that.

Thanks!

I'm sorry, I'm not a programmer, what does the code you posted do?

Is there a way to link customer groups to services within the gui?
OTRS 3.1.3 + ITSM 3.1.1 + FAQ 2.1.2 + Survey 2.1.3, Redhat
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

adupre01 wrote:what does the code you posted do?
I'm not sure I understand your question. If you pass a customer's login and the name of a service, the customer will be assigned the service.

If you want to know *how* it does it, it's not too hard to observe, but basically, it gathers all the pieces that it needs from the command line, then makes a bunch of objects that are required to talk to the service API.

Then it checks if the customer login is valid, then the service name ... if they don't match, they'll error, if they're valid, then the service is assigned to the customer, unless there's another error.

(either way you want to say it.)

But the goal is to do this from the command line, as requested.
If you wanted to batch assign services, you'd make a two-column spreadsheet containing login and service name.
Then you could do something like

Code: Select all

="bin/AddUser2Service.pl -u " & A2 & " -s " &B2
in the third column(where A is logins, and B is services), copy/paste the third column to a command prompt.
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
adupre01
Znuny newbie
Posts: 73
Joined: 09 Jun 2011, 18:22
Znuny Version: 3.0
Real Name: Andre
Company: Hamline University

Re: Link Services to Customers - too many customers displaye

Post by adupre01 »

Gotcha, I was just trying to clarify if the code you posted was in response to jreno about scripting it or in response to my question about assigning services to groups.

I take it there is not a way to assign services to groups through the admin interface? As I said before I am not a programmer and we are trying to do as little actual coding as possible and as much of the configuration through the admin interface (or sysconfig if necessary).
OTRS 3.1.3 + ITSM 3.1.1 + FAQ 2.1.2 + Survey 2.1.3, Redhat
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

currently, there is no provision to connect groups and services.

I was going to provide such a script, but there appears to be a bug which currently prevents obtaining the customer usernames belonging to a customer group.

On the other hand, adding a bunch of LDAP members to specific groups isn't any easier through the gui than adding them to a service.
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
adupre01
Znuny newbie
Posts: 73
Joined: 09 Jun 2011, 18:22
Znuny Version: 3.0
Real Name: Andre
Company: Hamline University

Re: Link Services to Customers - too many customers displaye

Post by adupre01 »

Well, organizationally it makes sense for us to have our users ordered into groups and then as the services change/grow to add those services to groups. Our groups change less frequently and we are planning to add more services later. But I see your point in general about adding it manually one or the other.
OTRS 3.1.3 + ITSM 3.1.1 + FAQ 2.1.2 + Survey 2.1.3, Redhat
jreno
Znuny newbie
Posts: 34
Joined: 20 Jul 2011, 15:15
Znuny Version: 3.0.10
Real Name: Peter Miller
Company: PC

Re: Link Services to Customers - too many customers displaye

Post by jreno »

@crythias:

Great work, thanks, now though I am not a Perl/PHP script person I can use it in shell scripts!
I am also looking for a way to manipulate the CustomerId of a Customer-User, I guess its only a small change but I dont want to break up snything.
Thanks again.
--
OTRS 3.0.10 running on Debian Squeeze || Serving 600 users / 20 queues / 10 companies
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Link Services to Customers - too many customers displaye

Post by crythias »

jreno wrote:I am also looking for a way to manipulate the CustomerId of a Customer-User
Start a new topic on this, please. But the short answer is you can manipulate the user table directly in SQL for this purpose unless you're using a different back end (like LDAP) and then you'd have to make the CustomerID be from, for instance, Department or other field.
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
jreno
Znuny newbie
Posts: 34
Joined: 20 Jul 2011, 15:15
Znuny Version: 3.0.10
Real Name: Peter Miller
Company: PC

Re: [WorkAround] Too Many Customers Displayed to Link to Ser

Post by jreno »

Thanks, thats what I finally ended up doing.
F* the GUI! I switched to:

Code: Select all

mysql>
and

Code: Select all

bash$
for future bulk operations.
--
OTRS 3.0.10 running on Debian Squeeze || Serving 600 users / 20 queues / 10 companies
Locked