Discussion:
[otrs] Master Ticket Documentation
Peter Beckman
2009-10-09 06:59:25 UTC
Permalink
I posted about this need a few months ago, was hoping that maybe 2.4.4 is
the great white hope.

http://lists.otrs.org/pipermail/otrs/2009-February/025597.html

I finally gave up on the script and did them manually, because the API was
too confusing.

I simply need to email 21 people the same email and open 21 tickets. They
can all be immediately closed, but I need to basically open the same ticket
21 times.

But I only want to do this once.

Can OTRS do it in the web interface? Easily? Am I still stuck writing a
script that accesses the API in order to do this?

---------------------------------------------------------------------------
Peter Beckman Internet Guy
***@angryox.com http://www.angryox.com/
---------------------------------------------------------------------------
Michiel Beijen
2009-10-09 10:02:40 UTC
Permalink
Hi Peter,

Have you read the thread called 'enable Master/Slave ticket feature' from
this week?

and also the youtube vid:


You should still create 21 tickets of course, but they can be created very
fast and linked to the master ticket. You can send out emails and close the
child tickets from the master.

If you'd want to create tickets even faster, you could look into using
Ticket Templates:
http://www.jbothe.de/blog/?p=130

HTH.
--
Michiel Beijen
R&D

OTRS AG
Norsk-Data-Str 1.
61352 Bad Homburg
Deutschland

T: +31 (0) 6457 42418
F: +49 (0) 9421 56818-18
I: http://www.otrs.com/

Business Location: Bad Homburg, Country Court: Bad Homburg, Commercial
register: 10751, Tax ID: 003 240
97505 Chairman of the Board: Burchard Steinbild, Managing Board: André
Mindermann (CEO), Martin Edenhofer

CU@ IIR Service Desk Forum in Mainz
(Germany)<http://www.otrs.com/en/news-and-press/news-details/article/translate-to-english-otrs-at-the-13th-iir-service-desk-forum-2009/?tx_ttnews%5BbackPid%5D=51&cHash=ef91fa143e>and
get to know more about OTRS at booth no. 12 from Nov 24-25, 2009!
Post by Peter Beckman
I posted about this need a few months ago, was hoping that maybe 2.4.4 is
the great white hope.
http://lists.otrs.org/pipermail/otrs/2009-February/025597.html
I finally gave up on the script and did them manually, because the API was
too confusing.
I simply need to email 21 people the same email and open 21 tickets. They
can all be immediately closed, but I need to basically open the same ticket
21 times.
But I only want to do this once.
Can OTRS do it in the web interface? Easily? Am I still stuck writing a
script that accesses the API in order to do this?
---------------------------------------------------------------------------
Peter Beckman Internet Guy
http://www.angryox.com/
---------------------------------------------------------------------------
---------------------------------------------------------------------
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
NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW!
http://www.otrs.com/en/support/enterprise-subscription/
Peter Beckman
2009-10-09 17:23:12 UTC
Permalink
Post by Michiel Beijen
Have you read the thread called 'enable Master/Slave ticket feature' from
this week? and also the youtube vid: http://youtu.be/zkc_qTCSloo
Just did now. While creating a Master seems easy, the process to make a
Master after the fact is pretty convoluted! The video did help me
understand the purpose.
Post by Michiel Beijen
You should still create 21 tickets of course, but they can be created
very fast and linked to the master ticket. You can send out emails and
close the child tickets from the master.
If you'd want to create tickets even faster, you could look into using
Ticket Templates: http://www.jbothe.de/blog/?p=130
Since I don't read German, I had to use Google Translate, and to be
perfectly honest, I have no clue what his Blog Entry is attempting to
explain. I _THINK_ what he's adding is some buttons at the top of the
page that set a few of the page variables so that you don't have to fill
that in each time for a commonly recurring ticket response.

I see the value in that.

Still, this seems to be the recommended course of action:

1. Create a Master Ticket
2. Create 21 Slave Tickets (Phone?)
3. Send an email to the Master Ticket and close it.

That definitely helps the situation compared to 2.3.x. But I still have a
problem with "Create 21 Slave Tickets." That's something I have to do 21
times.

I have a customer database linked into OTRS, I'd like to simply provide a
comma delimited list of either userIDs or email addresses, and have OTRS
create a new ticket for each one. I know this can be accomplished with
the API, but for this instance, creating 21 tickets seems easier than
trying to learn the API and create a script. However, when 21 tickets
turns into 200 or 500, ouch.

I'm still shocked there is no easy way to use OTRS to proactively
communicate with a bulk set of customers.

Looking at the API, how would I use Kernel::System::Ticket->TicketCreate
to create tickets that are associated with a Master ticket? My guess:

$TicketObject->TicketFreeTextSet(
Counter => 1, # Or should this be 12 as in the video?
Key => 'Slave',
Value => '12481', # Ticket Number of the master
TicketID => '12482', # Ticket Number of the slave
UserID => 123, # Is this a Kernel::System::User or a Kernel::System::CustomerUser?
);

So maybe I can write something that, once I create the Master ticket, I
can write a short snippet that creates the tickets and then associates
them with the Master Ticket.

Beckman
---------------------------------------------------------------------------
Peter Beckman Internet Guy
***@angryox.com http://www.angryox.com/
---------------------------------------------------------------------------
Peter Beckman
2009-10-09 19:23:13 UTC
Permalink
So I've worked some on a bulk script. The tickets are being created, and
I'm even successfully associating the tickets to the Master!

Unfortunately, I'm missing something. I sent an email to the Master
ticket, and no emails went out to the other Slave Tickets.

In the Web UI, the Master Ticket shows "MasterTicket: Master" and shows 3
linked children, as expected. Looking at one of the slaves, it shows
"MasterTicket: Slave" and Linked Parent to the correct Master.

Free Fields correctly displays MasterTicket: Slave, and Link shows
correctly linked Parent.

Additionally, the correct Customer Info was displayed for the ticket, and
the fake Phone Article I created had the correct email for the customer.
Please note, this is using a config-based external Customer Database. I'm
not sure if that has something to do with this, but I assume not.

Here's the history for one of Slave Tickets after an email was sent to the
Master Ticket:

10/09/2009 14:55:39 NewTicket New Ticket [102082813683] created (Q=Raw;P=3 normal;S=new).
10/09/2009 14:55:39 CustomerUpdate Updated: CustomerID=xxxx;CustomerUser=***@xxxxxxxxxxxx;
10/09/2009 14:55:39 EmailCustomer Created by BulkTicket Script
10/09/2009 14:55:39 TicketFreeTextUpdate Updated: FreeKey12=MasterTicket;FreeText12=Slave;
10/09/2009 14:55:39 TicketLinkAdd Added link to ticket "103395832887".
10/09/2009 14:57:13 Misc MasterTicket: no customer email found, send no master message to customer.
10/09/2009 14:57:13 StateUpdate Old: "new" New: "closed successful"

I see the problem, no customer email found, but where am I not setting
that? The %User object returns the customers email as UserID, and that is
used in both the Ticket and Article creation.

Any API hackers want to help? The documentation is pretty sparse when it
comes to listing and explaining all possible values for Ticket Creation.
Even LinkAdd() didn't mention "Direction" nor why it was excluded, if
indeed that was on purpose.

The code:

===========================================================================


#!/usr/bin/perl -w
# --
# otrs.bulkSlaveTicketCreate
#
# Quickly Create multiple Slave tickets associated with a Master ticket
#
# Written by Peter Beckman <beckman at angryox dot com>
# October 9, 2009
# --
# License: Creative Commons Attribution-Share Alike 3.0 United States License
# More Info: http://creativecommons.org/licenses/by-sa/3.0/us/
# This software comes with ABSOLUTELY NO WARRANTY.
# --

use File::Basename;
use FindBin qw($RealBin);
use lib dirname($RealBin);
use lib dirname($RealBin)."/Kernel/cpan-lib";
use Data::Dumper;

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

my $ConfigObject = Kernel::Config->new();

my $EncodeObject = Kernel::System::Encode->new(
ConfigObject => $ConfigObject,
);

my $LogObject = Kernel::System::Log->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
);

my $TimeObject = Kernel::System::Time->new(
LogObject => $LogObject,
ConfigObject => $ConfigObject,
);

my $MainObject = Kernel::System::Main->new(
LogObject => $LogObject,
EncodeObject => $EncodeObject,
ConfigObject => $ConfigObject,
);

my $DBObject = Kernel::System::DB->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
MainObject => $MainObject,
LogObject => $LogObject,
);

my $UserObject = Kernel::System::User->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
DBObject => $DBObject,
EncodeObject => $EncodeObject,
);

my $CustomerUserObject = Kernel::System::CustomerUser->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
EncodeObject => $EncodeObject,
UserObject => $UserObject,
);

my $TicketObject = Kernel::System::Ticket->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
EncodeObject => $EncodeObject,
CustomerUserObject => $CustomerUserObject,
UserObject => $UserObject,
);

my $LinkObject = Kernel::System::LinkObject->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
TimeObject => $TimeObject,
MainObject => $MainObject,
EncodeObject => $EncodeObject,
UserObject => $UserObject,
);

print "Enter Customer emails or IDs, separated by a comma.\n";
my $userlist = &promptUser("Customer Emails/IDs");

$userlist =~ s/\s+//g;
my @users = split(/,/, $userlist);

my @usergroup;
foreach(@users) {
my %List = $CustomerUserObject->CustomerSearch(
Search => "*$_*"
);
if (!%List) {
print "Could not find user matching $_\n";
next;
}
my @Foo = keys %List;
my %User = $CustomerUserObject->CustomerUserDataGet(
User => $Foo[0],
);
print "User: " . $User{'UserFirstname'} ." UID: ". $User{'UserCustomerID'} ."\n";
push @usergroup, \%User;
}

my $MasterTicketID = &promptUser("Master Ticket ID");

my $UserID = &promptUser("Agent UserID (numeric)");

# remove spaces
# split into an array
# foreach over the motherfucker to see if they are valid.

# Create multiple tickets
# Send multiple articles

foreach(@usergroup) {
print Dumper(\$_);
print "User: " . $_->{'UserFirstname'} ." UID: ". $_->{'UserCustomerID'} ."\n";
my $TicketID = $TicketObject->TicketCreate(
TN => $TicketObject->TicketCreateNumber(),
Queue => 'Raw',
Lock => 'unlock',
GroupID => 2,
Priority => '3 normal',
State => 'new',
CustomerNo => $_->{'UserCustomerID'},
CustomerUser => $_->{'UserID'},
OwnerID => $UserID, # current owner
UserID => $UserID,
);

if (!$TicketID) {
print "Unable to create Ticket for " . $_->{'UserCustomerID'} ."\n";
next;
}

print "Ticket (TicketID:$TicketID) created.\n";

# Add an article here with the
Michiel Beijen
2009-10-12 08:53:00 UTC
Permalink
Hi Peter,

I guess your script works for me... only you'd have to change
CustomerNo => $_->{'UserCustomerID'}, to CustomerID =>
$_->{'UserCustomerID'},
--
Michiel Beijen
R&D

OTRS AG
Norsk-Data-Str 1.
61352 Bad Homburg
Deutschland

T: +31 (0) 6457 42418
F: +49 (0) 9421 56818-18
I: http://www.otrs.com/

Business Location: Bad Homburg, Country Court: Bad Homburg, Commercial
register: 10751, Tax ID: 003 240
97505 Chairman of the Board: Burchard Steinbild, Managing Board: André
Mindermann (CEO), Martin Edenhofer

CU@ IIR Service Desk Forum in Mainz
(Germany)<http://www.otrs.com/en/news-and-press/news-details/article/translate-to-english-otrs-at-the-13th-iir-service-desk-forum-2009/?tx_ttnews%5BbackPid%5D=51&cHash=ef91fa143e>and
get to know more about OTRS at booth no. 12 from Nov 24-25, 2009!
Post by Peter Beckman
So I've worked some on a bulk script. The tickets are being created, and
I'm even successfully associating the tickets to the Master!
Unfortunately, I'm missing something. I sent an email to the Master
ticket, and no emails went out to the other Slave Tickets.
In the Web UI, the Master Ticket shows "MasterTicket: Master" and shows 3
linked children, as expected. Looking at one of the slaves, it shows
"MasterTicket: Slave" and Linked Parent to the correct Master.
Free Fields correctly displays MasterTicket: Slave, and Link shows
correctly linked Parent.
Additionally, the correct Customer Info was displayed for the ticket, and
the fake Phone Article I created had the correct email for the customer.
Please note, this is using a config-based external Customer Database. I'm
not sure if that has something to do with this, but I assume not.
Here's the history for one of Slave Tickets after an email was sent to the
10/09/2009 14:55:39 NewTicket New Ticket [102082813683]
created (Q=Raw;P=3 normal;S=new). 10/09/2009 14:55:39 CustomerUpdate
10/09/2009 14:55:39 EmailCustomer Created by BulkTicket Script
FreeKey12=MasterTicket;FreeText12=Slave; 10/09/2009 14:55:39
TicketLinkAdd Added link to ticket "103395832887". 10/09/2009
14:57:13 Misc MasterTicket: no customer email found,
send no master message to customer. 10/09/2009 14:57:13 StateUpdate
Old: "new" New: "closed successful"
I see the problem, no customer email found, but where am I not setting
that? The %User object returns the customers email as UserID, and that is
used in both the Ticket and Article creation.
Any API hackers want to help? The documentation is pretty sparse when it
comes to listing and explaining all possible values for Ticket Creation.
Even LinkAdd() didn't mention "Direction" nor why it was excluded, if
indeed that was on purpose.
===========================================================================
#!/usr/bin/perl -w
# --
# otrs.bulkSlaveTicketCreate
#
# Quickly Create multiple Slave tickets associated with a Master ticket #
# Written by Peter Beckman <beckman at angryox dot com>
# October 9, 2009
# --
# License: Creative Commons Attribution-Share Alike 3.0 United States License
# More Info: http://creativecommons.org/licenses/by-sa/3.0/us/
# This software comes with ABSOLUTELY NO WARRANTY.
# --
use File::Basename;
use FindBin qw($RealBin);
use lib dirname($RealBin);
use lib dirname($RealBin)."/Kernel/cpan-lib";
use Data::Dumper;
use Kernel::Config;
use Kernel::System::Encode;
use Kernel::System::Log;
use Kernel::System::Time;
use Kernel::System::Main;
use Kernel::System::DB;
use Kernel::System::Ticket;
use Kernel::System::CustomerUser;
use Kernel::System::User;
my $ConfigObject = Kernel::Config->new();
my $EncodeObject = Kernel::System::Encode->new(
ConfigObject => $ConfigObject,
);
my $LogObject = Kernel::System::Log->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
);
my $TimeObject = Kernel::System::Time->new(
LogObject => $LogObject,
ConfigObject => $ConfigObject,
);
my $MainObject = Kernel::System::Main->new(
LogObject => $LogObject,
EncodeObject => $EncodeObject,
ConfigObject => $ConfigObject,
);
my $DBObject = Kernel::System::DB->new(
ConfigObject => $ConfigObject,
EncodeObject => $EncodeObject,
MainObject => $MainObject,
LogObject => $LogObject,
);
my $UserObject = Kernel::System::User->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
DBObject => $DBObject,
EncodeObject => $EncodeObject,
);
my $CustomerUserObject = Kernel::System::CustomerUser->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
EncodeObject => $EncodeObject,
UserObject => $UserObject,
);
my $TicketObject = Kernel::System::Ticket->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
MainObject => $MainObject,
TimeObject => $TimeObject,
EncodeObject => $EncodeObject,
CustomerUserObject => $CustomerUserObject,
UserObject => $UserObject,
);
my $LinkObject = Kernel::System::LinkObject->new(
ConfigObject => $ConfigObject,
LogObject => $LogObject,
DBObject => $DBObject,
TimeObject => $TimeObject,
MainObject => $MainObject,
EncodeObject => $EncodeObject,
UserObject => $UserObject,
);
print "Enter Customer emails or IDs, separated by a comma.\n";
my $userlist = &promptUser("Customer Emails/IDs");
$userlist =~ s/\s+//g;
my %List = $CustomerUserObject->CustomerSearch(
Search => "*$_*"
);
if (!%List) {
print "Could not find user matching $_\n";
next;
}
my %User = $CustomerUserObject->CustomerUserDataGet(
User => $Foo[0],
);
print "User: " . $User{'UserFirstname'} ." UID: ".
$User{'UserCustomerID'} ."\n";
}
my $MasterTicketID = &promptUser("Master Ticket ID");
my $UserID = &promptUser("Agent UserID (numeric)");
# remove spaces
# split into an array
# foreach over the motherfucker to see if they are valid.
# Create multiple tickets
# Send multiple articles
print Dumper(\$_);
print "User: " . $_->{'UserFirstname'} ." UID: ". $_->{'UserCustomerID'} ."\n";
my $TicketID = $TicketObject->TicketCreate(
TN => $TicketObject->TicketCreateNumber(),
Queue => 'Raw',
Lock => 'unlock',
GroupID => 2,
Priority => '3 normal',
State => 'new',
CustomerNo => $_->{'UserCustomerID'},
CustomerUser => $_->{'UserID'},
OwnerID => $UserID, # current owner
UserID => $UserID,
);
if (!$TicketID) {
print "Unable to create Ticket for " . $_->{'UserCustomerID'} ."\n";
next;
}
print "Ticket (TicketID:$TicketID) created.\n";
Continue reading on narkive:
Loading...