[rt-users] Show tickets depending on creator and not owner

Fabian Unfried funfried at zebra.com
Mon Jul 4 06:02:19 EDT 2011


I was able to do the script by my own, thanks to the rt wiki, if someone is interested in the script, here it is:

my $scrip = 'Script:AutoAddCreatorAsRequestor';

# Get Current Ticket
my $Ticket = $self->TicketObj;
# Get Current Ticket ID
my $Id = $Ticket->id;
# Get E-Mail-Address of creator
my $EmailAddr = $self->TransactionObj->CreatorObj->EmailAddress;
# Get user object of creator
my $User = RT::User->new($RT::SystemUser);
$User->LoadByEmail($EmailAddr);
# Type of watch
my $type = 'Requestor';
# Principal of user
my $Principal = $User->PrincipalId;

# Add the creator as a watcher of type $type (requestor)
my ($ret, $msg) = $Ticket->AddWatcher(Type  => $type, Email => $EmailAddr, PrincipalId => $Principal,);

# Check if adding was successful
if ($ret) {
  $RT::Logger->info("$scrip: New $type watcher added to ticket #$Id: $EmailAddr (#$Principal)");
} else {
  $RT::Logger->error("$scrip: Failed to add new $type watcher to ticket #$Id: $EmailAddr (#$Principal) - $msg");
}

return 1;


It is really similar to this one, but much easier: http://requesttracker.wikia.com/wiki/AddWatchersOnCorrespond
If someone can see some critical code in it, please let me know! Thanks in advance.

And finally, rt is really great, now it does everything I need, nice job guys!


Regards,
Fabian

Am 04.07.2011 um 10:55 schrieb Fabian Unfried:

> Hi Kenn,
> 
> that helped a lot, THANKS! My problem was that I thought the creator is automatically the requestor, I've got everything working as long as I manually add the creator of a ticket as one of the requestors, but how could I automatically do that?
> Could someone tell me how a script would look like, that automatically adds the creator of a ticket as the requestor when the ticket is created?
> 
> Regards,
> Fabian
> 
> 
> Am 01.07.2011 um 18:41 schrieb Kenneth Crocker:
> 
>> Fabian,
>> 
>> First of all, the "Creator" does NOT have to be the Requestor. When creating a new ticket via WebUI, just override the UserID/Email Address to represent the person who wants the work to be done. RT will STILL maintain the creators UserID.
>> 
>> Second, all you have to do is grant "SeeQueue" and "ShowTicket" to the "Requestor" role at whatever level you need this (Queue or Global). You might want to add "ReplyToTicket" as well if you want them to be able to add continuing thoughts (by sending an email to the same Queue address with the ticket number referenced in the subject line) at any time while the ticket is open.
>> 
>> I just gave some basic concepts about rights in this list just awhile ago.
>> 
>> Hope this helps.
>> 
>> Kenn
>> LBNL
>> 
>> On Fri, Jul 1, 2011 at 1:49 AM, Fabian Unfried <funfried at zebra.com> wrote:
>> Hi Kenn,
>> 
>>> Fabian,
>>> 
>>> What is the relationship of your "creator" and the ticket Owner and the ticket Requestor?
>> 
>> Creator => Requestor (sorry, I guess that made my question a bit confusing)
>> As far as I understood rt the owner is the user which the ticket is assigned to, or did I misunderstood something there?
>> 
>>> Are they usually the same?
>> 
>> I think it's some kind of the standard approach, so the requestor stays always the same, but the owner is changing while the ticket will be solved. But my problem is as long as the requestor isn't the owner, the requestors can't see their tickets in their WebUI under open tickets, but I would like that they can see their tickets also when some of the admins or staff (privileged user) is assigned to their tickets. Is this possible?
>> 
>>> Do the tickets get created via email or WebUI?
>> 
>> WebUI
>> 
>> 
>> Regards
>> Fabian
>> 
>> 
>>> 
>>> Kenn
>>> LBNL
>>> 
>>> On Thu, Jun 30, 2011 at 8:34 AM, Fabian Unfried <funfried at zebra.com> wrote:
>>> Hi guys,
>>> 
>>> just started with rt 4.0.1 and it is really great, but one question:
>>> 
>>> Is there a way to show the tickets for the customers (unprivileged users) not only when they are assigned to it but also because they are the creator of a ticket? So to say I would like that a creator of a ticket can always see his/her ticket not only when he/she is assigned to his/her ticket.
>>> 
>>> Thanks in advance.
>>> 
>>> Regards,
>>> Fabian
>>> 
>>> 
>>> - CONFIDENTIAL-
>>> 
>>> This email and any files transmitted with it are confidential, and may also be legally privileged.  If you are not the intended recipient, you may not review, use, copy, or distribute this message. If you receive this email in error, please notify the sender immediately by reply email and then delete this email.
>>> 
>>> --------
>>> 2011 Training: http://bestpractical.com/services/training.html
>>> 
>>> <ATT00001..txt>
>> 
>> 
>> --
>> Fabian Unfried
>> Senior Software Engineer
>> Zebra Enterprise Solutions
>> 
>> Rossfelder Str. 65/5, 74564 Crailsheim, Germany
>> T+49 7951 96360 F+49 7951 963611
>> funfried at zebra.com
>> www.zebra.com/zes
>> WhereNet * proveo * Multispectral Solutions
>> 
>> Managing Directors Zebra Enterprise Solutions GmbH:
>> Phil Gerskovich, Gilles Pelzer, Michael Smiley
>> Registered Office: Ulm, HRB 721672
>> VAT Number: DE225496806
>> 
>> 
>> <ATT00001..txt>
> 
> 
> --
> Fabian Unfried
> Senior Software Engineer
> Zebra Enterprise Solutions
> 
> Rossfelder Str. 65/5, 74564 Crailsheim, Germany
> T+49 7951 96360 F+49 7951 963611
> funfried at zebra.com
> www.zebra.com/zes
> WhereNet * proveo * Multispectral Solutions
> 
> Managing Directors Zebra Enterprise Solutions GmbH:
> Phil Gerskovich, Gilles Pelzer, Michael Smiley
> Registered Office: Ulm, HRB 721672
> VAT Number: DE225496806
> 
> <ATT00001..txt>


--
Fabian Unfried
Senior Software Engineer
Zebra Enterprise Solutions

Rossfelder Str. 65/5, 74564 Crailsheim, Germany
T+49 7951 96360 F+49 7951 963611
funfried at zebra.com
www.zebra.com/zes
WhereNet * proveo * Multispectral Solutions

Managing Directors Zebra Enterprise Solutions GmbH:
Phil Gerskovich, Gilles Pelzer, Michael Smiley
Registered Office: Ulm, HRB 721672
VAT Number: DE225496806

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110704/7212dde9/attachment.htm>


More information about the rt-users mailing list