RTIR: Best way for customers to see all tickets for their employees


#1

I have customers with hundreds of employees, and a few of them submit
tickets. With RT and RTIR, what’s the best way to allow a customer to
log in and see tickets in both RT and RTIR that users in their company
have submitted? Can I set it up per department as well?

I’ve looked into the custom roles idea, but I’m just not grasping the
concept. Can someone give me a complete example?

Thank you!

Best regards,
Steve

Stephen H. Switzer
President & Chief Technical Consultant

steve@SBSroc.com

MAIN:
CELL:
+1 (585) 298-9420 EXT: 7001
+1 (585) 202-8312

Support Desk:
support@sbsroc.com

FAX:
+1 (585) 625-0020

This e-mail contains proprietary information some or all of which may be
legally privileged. It is for the intended recipient only. If an
addressing or transmission error has misdirected this e-mail, please
notify the author by replying to this e-mail. If you are not the
intended recipient you must not use, disclose, distribute, copy, print
or rely on this e-mail. The content of this email may contain private
views and opinions, which do not constitute formal disclosure or
commitment unless specifically stated. We do not enter into legally
binding agreements via email.

	 [1]
	 [2]
	 [3]
	 [4]
	 [5]

Links:
[1] http://www.sbsroc.com
[2] https://plus.google.com/+SwitzerBusinessSolutionsLLCRochester
[3] https://www.facebook.com/sbsolutions
[4] https://www.linkedin.com/company/switzer-business-solutions-llc
[5] https://twitter.com/sbsroc


#2

BumpOn 2016-11-17 12:45 pm, Stephen Switzer wrote:

I have customers with hundreds of employees, and a few of them submit tickets. With RT and RTIR, what’s the best way to allow a customer to log in and see tickets in both RT and RTIR that users in their company have submitted? Can I set it up per department as well?

I’ve looked into the custom roles idea, but I’m just not grasping the concept. Can someone give me a complete example?

Thank you!


Best regards,
Steve

Stephen H. Switzer
President & Chief Technical Consultant

steve@SBSroc.com

MAIN:
CELL:
+1 (585) 298-9420 EXT: 7001
+1 (585) 202-8312

Support Desk:
support@sbsroc.com

FAX:
+1 (585) 625-0020

This e-mail contains proprietary information some or all of which may be legally privileged. It is for the intended recipient only. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print or rely on this e-mail. The content of this email may contain private views and opinions, which do not constitute formal disclosure or commitment unless specifically stated. We do not enter into legally binding agreements via email.

[1]
[2]
[3]
[4]
[5]


RT 4.4 and RTIR training sessions, and a new workshop day! https://bestpractical.com/training

  • Los Angeles - January 9-11 2017

Links:
[1] http://www.sbsroc.com
[2] https://plus.google.com/+SwitzerBusinessSolutionsLLCRochester
[3] https://www.facebook.com/sbsolutions
[4] https://www.linkedin.com/company/switzer-business-solutions-llc
[5] https://twitter.com/sbsroc


#3

Please excuse the re-post, but I’ve made some progress today, and I
think I just need a tweak. I have the following code in “Custom action
preparation code”:

my $groupname=‘Cust-Customer1’;

Load the custom group from RT

my $groupObj = RT::Group->new($RT::SystemUser);
$groupObj->LoadUserDefinedGroup($groupname);
return undef unless $groupObj;

#This worked
#my $admincclist = $self->TicketObj->AdminCc;
#$admincclist->AddMember($groupObj->Id);

#This doesn’t work…
$self->TicketObj->AddWatcher(
Type=>“Customer”,
PrincipalId=>$groupObj->Id
);
return 1;

Can anyone shed light on how to add a custom role member to a ticket on
create? If I uncomment the admincclist lines, I get it added to the
AdminCC field… but not the Customer custom role. I see no errors in
the rt.log file, which is set to warning.

Thank you!

SteveOn 2016-12-05 2:04 pm, Stephen Switzer wrote:

Bump

On 2016-11-17 12:45 pm, Stephen Switzer wrote:

I have customers with hundreds of employees, and a few of them submit tickets. With RT and RTIR, what’s the best way to allow a customer to log in and see tickets in both RT and RTIR that users in their company have submitted? Can I set it up per department as well?

I’ve looked into the custom roles idea, but I’m just not grasping the concept. Can someone give me a complete example?

Thank you!


Best regards,
Steve


#4

Please excuse the re-post, but I’ve made some progress today, and I think I just need a tweak. I have the following code in “Custom action preparation code”:

my $groupname=‘Cust-Customer1’;

Load the custom group from RT

my $groupObj = RT::Group->new($RT::SystemUser); $groupObj->LoadUserDefinedGroup($groupname);
return undef unless $groupObj;

#This worked
#my $admincclist = $self->TicketObj->AdminCc;
#$admincclist->AddMember($groupObj->Id);

#This doesn’t work…
$self->TicketObj->AddWatcher(
Type=>“Customer”,
PrincipalId=>$groupObj->Id
);
return 1;

Can anyone shed light on how to add a custom role member to a ticket on create? If I uncomment the admincclist lines, I get it added to the AdminCC field… but not the Customer custom role. I see no errors in the rt.log file, which is set to warning.

Thank you!

I’m not sure exactly why it’s not working but you could check out the return value from $self->TicketObj->AddWatcher() and see if there’s any useful information in there since AddWatcher() returns a tuple of (status, message).

Untested code:

my $groupname=‘Cust-Customer1’;

Load the custom group from RT

my $groupObj = RT::Group->new($RT::SystemUser);
$groupObj->LoadUserDefinedGroup($groupname);
return undef unless $groupObj;

#This worked
#my $admincclist = $self->TicketObj->AdminCc;
#$admincclist->AddMember($groupObj->Id);

#This doesn’t work…
my ($status, $message) = $self->TicketObj->AddWatcher(
Type => “Customer”,
PrincipalId => $groupObj->Id
);
RT->Logger->warning(“AddWatcher Status: $status”);
RT->Logger->warning(“AddWatcher Message: $message”);
return 1;

Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
:e-mail: lstewart@internap.commailto:lstewart@internap.com
:earth_africa: www.internap.comhttp://www.internap.com


#5

I very much appreciate your response. This is what this gave me:

[27999] [Mon Dec 5 23:22:01 2016] [warning]: AddWatcher Status: 0
((eval 471):14)
[27999] [Mon Dec 5 23:22:01 2016] [warning]: AddWatcher Message: That
role is invalid for this object ((eval 471):15)

The custom role indeed “Applies to” the queue that the ticket was
created in, so I’m confused… scripts don’t support custom roles, maybe?

Best regards,
SteveOn 12/05/2016 05:24 PM, Landon Stewart wrote:

On Dec 5, 2016, at 12:21 PM, Stephen Switzer <steve@sbsroc.com mailto:steve@sbsroc.com> wrote:

Please excuse the re-post, but I’ve made some progress today, and I
think I just need a tweak. I have the following code in “Custom
action preparation code”:

my $groupname=‘Cust-Customer1’;

Load the custom group from RT

my $groupObj = RT::Group->new($RT::SystemUser);
$groupObj->LoadUserDefinedGroup($groupname);
return undef unless $groupObj;

#This worked
#my $admincclist = $self->TicketObj->AdminCc;
#$admincclist->AddMember($groupObj->Id);

#This doesn’t work…
$self->TicketObj->AddWatcher(
Type=>“Customer”,
PrincipalId=>$groupObj->Id
);
return 1;

Can anyone shed light on how to add a custom role member to a ticket
on create? If I uncomment the admincclist lines, I get it added to
the AdminCC field… but not the Customer custom role. I see no
errors in the rt.log file, which is set to warning.

Thank you!

I’m not sure exactly why it’s not working but you could check out the
return value from $self->TicketObj->AddWatcher() and see if there’s
any useful information in there since AddWatcher() returns a tuple of
(status, message).

Untested code:

my $groupname=‘Cust-Customer1’;

Load the custom group from RT

my $groupObj = RT::Group->new($RT::SystemUser);
$groupObj->LoadUserDefinedGroup($groupname);
return undef unless $groupObj;

#This worked
#my $admincclist = $self->TicketObj->AdminCc;
#$admincclist->AddMember($groupObj->Id);

#This doesn’t work…
*my ($status, $message) = *$self->TicketObj->AddWatcher(
Type => “Customer”,
PrincipalId => $groupObj->Id
);
RT->Logger->warning(“AddWatcher Status: $status”);
RT->Logger->warning(“AddWatcher Message: $message”);
return 1;


Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
:e-mail: lstewart@internap.com mailto:lstewart@internap.com
:earth_africa: www.internap.com http://www.internap.com


#6

I’m bumping this old thread for the benefit of future searchers, as I was stuck on this same point of “That role is invalid for this object”.

What made me realize the issue was printing $self->TicketObj->Roles
which showed that a custom role “foo” is not actually called “foo” internally but eg. RT::CustomRole-5

Thus, what you actually need to do in order to add a group to a custom role named Customer is:

my $role = RT::CustomRole->new( $self->CurrentUser );
$role->Load( "Customer" );

my ($success, $msg) = $self->TicketObj->AddWatcher( Type => $role->GroupType, PrincipalId => $groupObj->Id );

Best regards