Resolve Ticket Option


#1

I’d like to offer my customers an option to resolve a ticket
themselves, however I don’t want them to have the Modify Ticket
permission (which I think is the one you need for changing status).

Does anyone know of a way round this? I’m running 3.6.3

Cheers,

Justin

Justin Hayes
Support Manager
justin.hayes@orbisuk.com


#2

Hi Justin,

sure. Establish a custom field with the right ModifyCustomField for the
user. Use the CF to trigger a scrip which sets the ticket to resolved.

Ben

Justin Hayes schrieb:


#3

Hi Ben,

Thanks for that suggestion - had forgotten you can scrip based on the
change to a custom field. However can you grant permissions to
specific custom fields? I have others and don’t want the customer to
be able to change those.

I had been thinking somewhere along the lines of altering the
SetStatus fucntion in Ticket_Overlay.pm

It currently does this:

 #Check ACL
 if ( $args{Status} eq 'deleted') {
         unless ($self->CurrentUserHasRight('DeleteTicket')) {
         return ( 0, $self->loc('Permission Denied') );
    }
 } else {
         unless ($self->CurrentUserHasRight('ModifyTicket')) {
         return ( 0, $self->loc('Permission Denied') );
    }
 }

I was thinking about trying:

 #Check ACL
 if ( $args{Status} eq 'deleted') {
         unless ($self->CurrentUserHasRight('DeleteTicket')) {
         return ( 0, $self->loc('Permission Denied') );
 } elsif ( $args{Status} eq 'resolved') {
    # do nothing as we don't mind people resolving
 } else {
         unless ($self->CurrentUserHasRight('ModifyTicket')) {
         return ( 0, $self->loc('Permission Denied') );
    }
 }

I figured that would be ok as you’d have to have the permission to see
the ticket in the first place.

Your method might be safer though, as you can permission it.

Justin

Justin Hayes
Support Manager
justin.hayes@orbisuk.comOn 25 Jun 2008, at 09:45, Benjamin Weser wrote:

Hi Justin,

sure. Establish a custom field with the right ModifyCustomField for
the user. Use the CF to trigger a scrip which sets the ticket to
resolved.

Ben

Justin Hayes schrieb:

I’d like to offer my customers an option to resolve a ticket
themselves, however I don’t want them to have the Modify Ticket
permission (which I think is the one you need for changing status).

Does anyone know of a way round this? I’m running 3.6.3

Cheers,

Justin


Justin Hayes
Support Manager
justin.hayes@orbisuk.com


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly
Media. Buy a copy at http://rtbook.bestpractical.com


#4

Hmm another interesting suggestion, thanks! :slight_smile:

But aren’t you checking that it’s the owner that’s doing the resolving?

if ( $Ticket->OwnerObj->Name eq $session{‘CurrentUser’}->Name )

I’m after letting the customer resolve, and they won’t be the owner.

Also you’re calling the SetStatus function. Doesn’t that check that
you have ModifyTicket?

 } else {
         unless ($self->CurrentUserHasRight('ModifyTicket')) {
         return ( 0, $self->loc('Permission Denied') );
    }
 }

Or does that code in <%INIT> run as if you’re the main RT user or
something, thus you have permission if you run SetStatus in <%INIT>?

Justin

Justin Hayes
Support Manager
justin.hayes@orbisuk.comOn 25 Jun 2008, at 10:08, Brian Gallew wrote:

Justin Hayes wrote:

I’d like to offer my customers an option to resolve a ticket
themselves, however I don’t want them to have the Modify Ticket
permission (which I think is the one you need for changing status).
Does anyone know of a way round this? I’m running 3.6.3

Sure. Create
$RTHOME/local/html/Callbacks/orbisuk/SelfService/Elements/Tabs/
Default that looks something like this:
==========================CUT HERE==========================
<%ARGS>
$actions
$Ticket
</%ARGS>
<%INIT>
if ($Ticket) {
my $id = $Ticket->id();
if ( $Ticket->OwnerObj->Name eq $session{‘CurrentUser’}->Name ) {
$actions->{‘D’} = { path => “SelfService/Resolve.html?id=” . $id,
title => loc(‘Owner Resolve’) };
};
}
</%INIT>

%# Local Variables:
%# mode:perl
%# End:
==========================CUT HERE==========================

Then you’ll need to create $RTHOME/local/html/SelfService/Resolve.html

==========================CUT HERE==========================
<%ARGS>
$Ticket
</%ARGS>
<%INIT>
if ($Ticket) {
my $id = $Ticket->id();
if ( $Ticket->OwnerObj->Name eq $session{‘CurrentUser’}->Name ) {
$Ticket->SetStatus(‘resolved’);
};
}
RT::Interface::Web::Redirect($RT::WebURL.“SelfService/”);
</%INIT>

%# Local Variables:
%# mode:perl
%# End:
==========================CUT HERE==========================

Caveat emptor: I’ve modeled the code after something I have running
which is similary, but I’ve never actually run it, so you may have
to experiment. Especially since I don’t actually do Perl. 8)

Also, notice that this marks the ticket resolved without actually
allowing the opportunity to add any commentary.


#5

Hi Justin,

I established the “indirect” method of changing the ticket status here
at our RT to get a kind of workflow. You can set permissions of each CF
at Configuration->Custom Fields->->Group Rights.

There you are able to give your user (or better your groups) the
ModifyCustomField right. You won’t need to set SeeCustomField or
ModifyCustomField globally then anymore. You just need to “select”
(activate) the CustomFields globally (for all queues) or on queue level.

Try it :slight_smile:
Ben

Justin Hayes schrieb:


#6

Excellent - I’d not noticed that I could set the custom field
permissions on a per-field basis. Learn something new every day :slight_smile:

I guess I could put a ‘Close’ link next to ‘Reply’ that pre-selects
the custom field. Then scrip the change to that.

Thanks!

Justin

Justin Hayes
Support Manager
justin.hayes@orbisuk.comOn 25 Jun 2008, at 10:20, Benjamin Weser wrote:

Hi Justin,

I established the “indirect” method of changing the ticket status
here at our RT to get a kind of workflow. You can set permissions of
each CF at Configuration->Custom Fields->->Group Rights.

There you are able to give your user (or better your groups) the
ModifyCustomField right. You won’t need to set SeeCustomField or
ModifyCustomField globally then anymore. You just need to
"select" (activate) the CustomFields globally (for all queues) or on
queue level.

Try it :slight_smile:
Ben

Justin Hayes schrieb:

Hi Ben,

Thanks for that suggestion - had forgotten you can scrip based on
the change to a custom field. However can you grant permissions to
specific custom fields? I have others and don’t want the customer
to be able to change those.

I had been thinking somewhere along the lines of altering the
SetStatus fucntion in Ticket_Overlay.pm

It currently does this:

#Check ACL
if ( $args{Status} eq ‘deleted’) {
unless ($self->CurrentUserHasRight(‘DeleteTicket’)) {
return ( 0, $self->loc(‘Permission Denied’) );
}
} else {
unless ($self->CurrentUserHasRight(‘ModifyTicket’)) {
return ( 0, $self->loc(‘Permission Denied’) );
}
}

I was thinking about trying:

#Check ACL
if ( $args{Status} eq ‘deleted’) {
unless ($self->CurrentUserHasRight(‘DeleteTicket’)) {
return ( 0, $self->loc(‘Permission Denied’) );
} elsif ( $args{Status} eq ‘resolved’) {
# do nothing as we don’t mind people resolving
} else {
unless ($self->CurrentUserHasRight(‘ModifyTicket’)) {
return ( 0, $self->loc(‘Permission Denied’) );
}
}

I figured that would be ok as you’d have to have the permission to
see the ticket in the first place.

Your method might be safer though, as you can permission it.

Justin


Justin Hayes
Support Manager
justin.hayes@orbisuk.com

On 25 Jun 2008, at 09:45, Benjamin Weser wrote:

Hi Justin,

sure. Establish a custom field with the right ModifyCustomField
for the user. Use the CF to trigger a scrip which sets the ticket
to resolved.

Ben

Justin Hayes schrieb:

I’d like to offer my customers an option to resolve a ticket
themselves, however I don’t want them to have the Modify Ticket
permission (which I think is the one you need for changing status).

Does anyone know of a way round this? I’m running 3.6.3

Cheers,

Justin


Justin Hayes
Support Manager
justin.hayes@orbisuk.com


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly
Media. Buy a copy at http://rtbook.bestpractical.com