Set priority based on requestor's group membership

Hi there, at our company there’s a group of people who get preferential
treatment because they’re top sales guys, and in order to make it easier on
our helpdesk techs, I’d like to have their tickets be prioritized
automatically based on membership to a group.
I’m not sure how to do a check for group membership in a scrip, I’ve been
looking through the mail archives but haven’t had any luck so far. Can
anyone recommend how to do this?

Basically I want the scrip to trigger if they’re a member, and set the
priority to something (say 80) on creation, and that’s all. Any help would
be appreciated on this one. Thanks!

-Steve

Just finished working on something very similar , I am guessing the top
sales guys would be the one creating a ticket, if this is the case you
can do a scrip:

my $CreatorObj = $self->TicketObj->CreatorObj ;
my $org = $CreatorObj->GroupMembership ;

if ( $org eq ‘The group you need’) {
$self->TicketObj->SetPriority(80);
}
return undef;

The function GroupMembership I created in User_Vendor.pm (or
User_Overlay.pm pending which ever you are using):

sub GroupMembership {
# Identify a group\s a user belong to
# Used in scrip action in queues

    # Expects a user id and return group name
    # If user belong to more than one it returns comma seperated list

    my $self = shift;
    my $MemberId = $self->Id ;

    my $group_list = '';

    my $Groups = RT::Groups->new($RT::SystemUser);
    $Groups->Limit( FIELD => 'Domain',OPERATOR => '=', VALUE => 

‘SystemInternal’);
$Groups->Limit( FIELD => ‘Domain’,OPERATOR => ‘=’, VALUE =>
‘UserDefined’);

    my $alias = $Groups->Join(
            TYPE       => 'left',
            ALIAS1     => 'main',
            FIELD1     => 'id',
            TABLE2     => 'GroupMembers',
            FIELD2     => 'GroupId'
    );
    $Groups->Limit(
            ALIAS      => $alias,
            FIELD      => 'MemberId',
            OPERATOR   => '=',
            VALUE      => $MemberId,
    );

    while ( my $Group = $Groups->Next ) {
            $group_list = $group_list.",".$Group->Name ;

    }
    $group_list =~ s/^,+// ;
    return $group_list ;

}

I am not 100% on the SetPriority syntax -you may need to check it–, we
do n’t use priority we use custom fields resembling priority.
Also note if the Creator (person) is a member of more than one group
then the $org will be list of group names separated by a comma , in that
case you maybe better off doing:
if ( $org =~ /The group name you need/) {
$self->TicketObj->SetPriority(80);
}

Regards;
Roy

Steve Hopps wrote:

This worked exactly right. I used =~ instead of eq, and otherwise just cut
and pasted your code. Thank you so much!!
-SOn Thu, May 28, 2009 at 12:02 PM, Raed El-Hames rfh@vialtus.com wrote:

Just finished working on something very similar , I am guessing the top
sales guys would be the one creating a ticket, if this is the case you can
do a scrip:

my $CreatorObj = $self->TicketObj->CreatorObj ;
my $org = $CreatorObj->GroupMembership ;

if ( $org eq ‘The group you need’) {
$self->TicketObj->SetPriority(80);
}
return undef;

The function GroupMembership I created in User_Vendor.pm (or
User_Overlay.pm pending which ever you are using):

sub GroupMembership {
# Identify a group\s a user belong to
# Used in scrip action in queues

  # Expects a user id and return group name
  # If user belong to more than one it returns comma seperated list

  my $self = shift;
  my $MemberId = $self->Id ;

  my $group_list = '';

  my $Groups = RT::Groups->new($RT::SystemUser);
  $Groups->Limit( FIELD => 'Domain',OPERATOR => '=', VALUE =>

‘SystemInternal’);
$Groups->Limit( FIELD => ‘Domain’,OPERATOR => ‘=’, VALUE =>
‘UserDefined’);

  my $alias = $Groups->Join(
          TYPE       => 'left',
          ALIAS1     => 'main',
          FIELD1     => 'id',
          TABLE2     => 'GroupMembers',
          FIELD2     => 'GroupId'
  );
  $Groups->Limit(
          ALIAS      => $alias,
          FIELD      => 'MemberId',
          OPERATOR   => '=',
          VALUE      => $MemberId,
  );

  while ( my $Group = $Groups->Next ) {
          $group_list = $group_list.",".$Group->Name ;

  }
  $group_list =~ s/^,+// ;
  return $group_list ;

}

I am not 100% on the SetPriority syntax -you may need to check it–, we do
n’t use priority we use custom fields resembling priority.
Also note if the Creator (person) is a member of more than one group then
the $org will be list of group names separated by a comma , in that case you
maybe better off doing:
if ( $org =~ /The group name you need/) {
$self->TicketObj->SetPriority(80);
}

Regards;
Roy

Steve Hopps wrote:

Hi there, at our company there’s a group of people who get preferential
treatment because they’re top sales guys, and in order to make it easier on
our helpdesk techs, I’d like to have their tickets be prioritized
automatically based on membership to a group.

I’m not sure how to do a check for group membership in a scrip, I’ve been
looking through the mail archives but haven’t had any luck so far. Can
anyone recommend how to do this?

Basically I want the scrip to trigger if they’re a member, and set the
priority to something (say 80) on creation, and that’s all. Any help would
be appreciated on this one. Thanks!

-Steve

Hi,

I have a RT 3.8 system. When an user write a comment or reply, the line space is always doubled. Anyways to fix that? Thanks!

Michael

I have a RT 3.8 system. When an user write a comment or reply, the
line space is always doubled. Anyways to fix that? Thanks!

Upgrade to 3.8.3
It was one of the RichTextEditor config options that wasn’t well
documented
and I finally found and fixed by source diving

-kevin

Thanks, Kevin. So if I upgrade to 3.8.3, the problem will be fixed or there will be options for me to change the setting?-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Thursday, May 28, 2009 4:29 PM
To: RT Users
Subject: Re: [rt-users] Double line space on Comment

On May 28, 2009, at 4:14 PM, Michael Mai wrote:

I have a RT 3.8 system. When an user write a comment or reply, the
line space is always doubled. Anyways to fix that? Thanks!

Upgrade to 3.8.3
It was one of the RichTextEditor config options that wasn’t well
documented
and I finally found and fixed by source diving

-kevin
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

Thanks, Kevin. So if I upgrade to 3.8.3, the problem will be fixed
or there will be options for me to change the setting?

If you upgrade to 3.8.3 the RichText editor will only generate

when hitting enter. There are no config options for this, if you
want to change it back you’ll need to configure the RichText editor
separately

-kevin

Kevin, I’m not seeing that behavior. I’ve upgraded to 3.8.3 and when using
the RichText editor, I still get

generated when hitting ‘enter’.
Basically, everything is double-spaced. Nor can I find a way to change
that behavior in preferences, in the settings when editing an individual
ticket, nor in RT_Config…

James MoseleyKevin Falcone falcone@bestpractical.com wrote:

If you upgrade to 3.8.3 the RichText editor will only generate

when hitting enter. There are no config options for this, if you
want to change it back you’ll need to configure the RichText editor
separately

-kevin

Kevin, I’m not seeing that behavior. I’ve upgraded to 3.8.3 and
when using
the RichText editor, I still get

generated when hitting ‘enter’.
Basically, everything is double-spaced.

Sounds like your upgrade didn’t take or you have cached JS
I see the behavior I describe on rt3.fsck.com which is using 3.8.3

Nor can I find a way to change
that behavior in preferences, in the settings when editing an
individual
ticket, nor in RT_Config…

As I mentioned, there is no preference at the RT level.

There are no config options for this, if you
want to change it back you’ll need to configure the RichText editor
separately

-kevin

Kevin, clearing the browser cache worked. I now see single spacing using
both IE8 and Firefox 3.0.10 when editing via the RT editor.

Thanks!

James Moseley

Kevin Falcone falcone@bestpractical.com wrote:

Sounds like your upgrade didn’t take or you have cached JS
I see the behavior I describe on rt3.fsck.com which is using 3.8.3

-kevin

Hello Kevin,

Could you please let me know which are those files to be edited for this
feature as even I tried to edit the same but unfortunately could not get it.

Also if possible can you test another thing?
When a ticket is created, we get a correspondence mail stating the ticket
subject owner and the link to the ticket something like this…

New Ticket has been created.

Tue May 26 10:32:13 2009: Request 162 was acted upon.
Transaction: Ticket created by Jacob
Queue: GeneralSubject: Template design replacement
Owner: Nobody
Requestors: jacob@kjdfhhg.com
Status: new
Ticket <URL: http://abc.fhgkj.cmn/Ticket/Display.html?id=162 >

Here when you click on the ticket URL it should open the ticket right? may
be by asking to login or so to proceed viewing the ticket.

*) Can you check if it opens by asking for a login or opens directly the
ticket in your RT 3.8.3?

What I am having is that if I sign in to RT and then click this link the
ticket opens as there is an active user session. If am not logged in it will
throw out an error stating…

“Can’t call method “HasRight” on an undefined value at
/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm line 3351.”

When referred to the rt.log I find this error:

[Tue May 26 12:05:14 2009] [error]: Couldn’t get principal for not
loaded object (/opt/rt3/bin/…/lib/RT/User_Overlay.pm:1154)

[Tue May 26 12:05:18 2009] [error]: Couldn’t get principal for not
loaded object (/opt/rt3/bin/…/lib/RT/User_Overlay.pm:1154)

*) Is this is a bug or what do I need to do to get this working?

*) Can this be solved by upgrading to RT 3.8.3?

I am using this on CentOS 5.2 vmware machine, Apache 1.3.x, MySQL 5.0.45, RT
3.8.2

Please suggest what I can do with this or where might the chances of
misconfiguration of RT? I am using basic method of authentication for
apache.

Thanks && Regards
Manohar

From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Friday, May 29, 2009 1:59 AM
To: RT Users
Subject: Re: [rt-users] Double line space on Comment

I have a RT 3.8 system. When an user write a comment or reply, the
line space is always doubled. Anyways to fix that? Thanks!

Upgrade to 3.8.3
It was one of the RichTextEditor config options that wasn’t well
documented
and I finally found and fixed by source diving

-kevin
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

Hello Kevin,

Here is an example of exactly what I need. Follow this link

http://rt3.fsck.com/Ticket/Display.html?id=8721&results=915934c49ede21

How to get this done, any idea…?

Thanks
ManoharFrom: H Manohar rayker [mailto:manohar.r@glowtouch.com]
Sent: Friday, May 29, 2009 8:31 AM
To: ‘RT Users’
Subject: RE: [rt-users] Double line space on Comment

Hello Kevin,

Could you please let me know which are those files to be edited for this
feature as even I tried to edit the same but unfortunately could not get it.

Also if possible can you test another thing?
When a ticket is created, we get a correspondence mail stating the ticket
subject owner and the link to the ticket something like this…

New Ticket has been created.

Tue May 26 10:32:13 2009: Request 162 was acted upon.
Transaction: Ticket created by Jacob
Queue: General
Subject: Template design replacement
Owner: Nobody
Requestors: jacob@kjdfhhg.com
Status: new
Ticket <URL: http://abc.fhgkj.cmn/Ticket/Display.html?id=162 >

Here when you click on the ticket URL it should open the ticket right? may
be by asking to login or so to proceed viewing the ticket.

*) Can you check if it opens by asking for a login or opens directly the
ticket in your RT 3.8.3?

What I am having is that if I sign in to RT and then click this link the
ticket opens as there is an active user session. If am not logged in it will
throw out an error stating…

“Can’t call method “HasRight” on an undefined value at
/opt/rt3/bin/…/lib/RT/Ticket_Overlay.pm line 3351.”

When referred to the rt.log I find this error:

[Tue May 26 12:05:14 2009] [error]: Couldn’t get principal for not
loaded object (/opt/rt3/bin/…/lib/RT/User_Overlay.pm:1154)

[Tue May 26 12:05:18 2009] [error]: Couldn’t get principal for not
loaded object (/opt/rt3/bin/…/lib/RT/User_Overlay.pm:1154)

*) Is this is a bug or what do I need to do to get this working?

*) Can this be solved by upgrading to RT 3.8.3?

I am using this on CentOS 5.2 vmware machine, Apache 1.3.x, MySQL 5.0.45, RT
3.8.2

Please suggest what I can do with this or where might the chances of
misconfiguration of RT? I am using basic method of authentication for
apache.

Thanks && Regards
Manohar

From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Friday, May 29, 2009 1:59 AM
To: RT Users
Subject: Re: [rt-users] Double line space on Comment

I have a RT 3.8 system. When an user write a comment or reply, the
line space is always doubled. Anyways to fix that? Thanks!

Upgrade to 3.8.3
It was one of the RichTextEditor config options that wasn’t well
documented
and I finally found and fixed by source diving

-kevin
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

Please suggest what I can do with this or where might the chances of
misconfiguration of RT? I am using basic method of authentication for
apache.

It sounds like you’ve misconfigured RT’s WebExternalAuth,
because you’re not getting a CurrentUser.
rt3.fsck.com’s behavior in this case is actually vanilla RT, so
whatever is causing it to break on your end is likely due to a local
misconfiguration

Please don’t hijack other people’s threads in the mailing
list to ask questions you asked 5 minutes ago.

-kevin