RT Query - Ticket SQL

To all,

I don't believe I have seen any threads on this question, but if so, 

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL

In SQL, you have to use % as a wildcard when doing a like query. If GL is a
prefix then you want to do Queue LIKE ‘GL%’.

Thank you,
Micah Gersten
Internal Developer
onShore Networks
www.onshore.com-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Thursday, March 27, 2008 3:13 PM
To: rt Users
Subject: [rt-users] RT Query - Ticket SQL

To all,

I don't believe I have seen any threads on this question, but if so,

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL

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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

Micah,

I do not believe the '%' works in RT for Queue. Try it out. I get 

nothing. I guess if someone wants to see 15 or more queues that start
with the same pre-fix in a search, they will have to add them one at a
time, waiting for the screen to refresh each time and go from there.
What an incredible waste of time.

Kenn
LBNLOn 3/27/2008 1:39 PM, Micah Gersten wrote:

In SQL, you have to use % as a wildcard when doing a like query. If GL is a
prefix then you want to do Queue LIKE ‘GL%’.

Thank you,
Micah Gersten
Internal Developer
onShore Networks
www.onshore.com

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Thursday, March 27, 2008 3:13 PM
To: rt Users
Subject: [rt-users] RT Query - Ticket SQL

To all,

I don’t believe I have seen any threads on this question, but if so,

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL


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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

You are the first one person who requested such functionality in UI.On Fri, Mar 28, 2008 at 12:39 AM, Kenneth Crocker KFCrocker@lbl.gov wrote:

Micah,

    I do not believe the '%' works in RT for Queue. Try it out. I get

nothing. I guess if someone wants to see 15 or more queues that start
with the same pre-fix in a search, they will have to add them one at a
time, waiting for the screen to refresh each time and go from there.
What an incredible waste of time.

Kenn
LBNL

On 3/27/2008 1:39 PM, Micah Gersten wrote:

In SQL, you have to use % as a wildcard when doing a like query. If GL is a
prefix then you want to do Queue LIKE ‘GL%’.

Thank you,
Micah Gersten
Internal Developer
onShore Networks
www.onshore.com

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Thursday, March 27, 2008 3:13 PM
To: rt Users
Subject: [rt-users] RT Query - Ticket SQL

To all,

  I don't believe I have seen any threads on this question, but if so,

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL


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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM


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

Best regards, Ruslan.

Ruslan,

What can I say? I'm just one of those guys who looks at things from a 

unique perspective ;-). Actually, the real need is based on the
situation I mentioned, a manager with many, many queues to manage. I
think it would be reasonable for a manager to want a query like that.
On another query note, I went ahead and built a query searching for 15
queues (queue = ‘xx’ OR queue = ‘yy’, etc) and when I went to the sort
preferences and specified queue. The results were NOT alphabetical at
all, it was by queue_id. Bummer. There was no option of selecting “Queue
Name” either. When I ran the search anyway and then "left-clicked’ the
Queue heading (supposed to cause results to re-sort by that heading), it
stretched out the subject column for 200 someodd spaces. Wierd also.
Then I tried to create a Time Worked search pulling the same queues and
tried to set the sort preference by owner and THAT also was not an
option. It seems to me that if you offer the time elements of a ticket,
why not offer the ability to sort the results by owner? Wouldn’t that be
a realistic need for a manager? Am I missing some parts for my search
engine or what? It seems a bit “unfinished”. Any help here would REALLY
be helpful. Thanks.

Kenn
LBNLOn 3/27/2008 2:51 PM, Ruslan Zakirov wrote:

You are the first one person who requested such functionality in UI.

On Fri, Mar 28, 2008 at 12:39 AM, Kenneth Crocker KFCrocker@lbl.gov wrote:

Micah,

    I do not believe the '%' works in RT for Queue. Try it out. I get

nothing. I guess if someone wants to see 15 or more queues that start
with the same pre-fix in a search, they will have to add them one at a
time, waiting for the screen to refresh each time and go from there.
What an incredible waste of time.

Kenn
LBNL

On 3/27/2008 1:39 PM, Micah Gersten wrote:

In SQL, you have to use % as a wildcard when doing a like query. If GL is a
prefix then you want to do Queue LIKE ‘GL%’.

Thank you,
Micah Gersten
Internal Developer
onShore Networks
www.onshore.com

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Thursday, March 27, 2008 3:13 PM
To: rt Users
Subject: [rt-users] RT Query - Ticket SQL

To all,

  I don't believe I have seen any threads on this question, but if so,

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL


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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM


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

Ruslan,

Any chance this feature can be added to the Search Builder?

Kenn
LBNLOn 3/27/2008 2:51 PM, Ruslan Zakirov wrote:

You are the first one person who requested such functionality in UI.

On Fri, Mar 28, 2008 at 12:39 AM, Kenneth Crocker KFCrocker@lbl.gov wrote:

Micah,

    I do not believe the '%' works in RT for Queue. Try it out. I get

nothing. I guess if someone wants to see 15 or more queues that start
with the same pre-fix in a search, they will have to add them one at a
time, waiting for the screen to refresh each time and go from there.
What an incredible waste of time.

Kenn
LBNL

On 3/27/2008 1:39 PM, Micah Gersten wrote:

In SQL, you have to use % as a wildcard when doing a like query. If GL is a
prefix then you want to do Queue LIKE ‘GL%’.

Thank you,
Micah Gersten
Internal Developer
onShore Networks
www.onshore.com

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Thursday, March 27, 2008 3:13 PM
To: rt Users
Subject: [rt-users] RT Query - Ticket SQL

To all,

  I don't believe I have seen any threads on this question, but if so,

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL


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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM


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

Patches are welcome.On Tue, Apr 1, 2008 at 3:11 AM, Kenneth Crocker KFCrocker@lbl.gov wrote:

Ruslan,

    Any chance this feature can be added to the Search Builder?

Kenn
LBNL

On 3/27/2008 2:51 PM, Ruslan Zakirov wrote:

You are the first one person who requested such functionality in UI.

On Fri, Mar 28, 2008 at 12:39 AM, Kenneth Crocker KFCrocker@lbl.gov wrote:

Micah,

    I do not believe the '%' works in RT for Queue. Try it out. I get

nothing. I guess if someone wants to see 15 or more queues that start
with the same pre-fix in a search, they will have to add them one at a
time, waiting for the screen to refresh each time and go from there.
What an incredible waste of time.

Kenn
LBNL

On 3/27/2008 1:39 PM, Micah Gersten wrote:

In SQL, you have to use % as a wildcard when doing a like query. If GL is a
prefix then you want to do Queue LIKE ‘GL%’.

Thank you,
Micah Gersten
Internal Developer
onShore Networks
www.onshore.com

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth
Crocker
Sent: Thursday, March 27, 2008 3:13 PM
To: rt Users
Subject: [rt-users] RT Query - Ticket SQL

To all,

  I don't believe I have seen any threads on this question, but if so,

please forgive me. I just re-named a bunch of queues to include a prefix
so that if a particular group works with tickets in several queues, they
can create a query that asks for queues LIKE “XX-” instead of listing
each queue they want to search. So, I went to “advanced” and change the
SQL from (Queue = ‘GL’ OR Queue = ‘AP’ etc.) to Queue LIKE ‘FS-’ and I
got garbage. Didn’t work at all. I tried a few variations like (Queue
LIKE ‘FS’) but to no avail. Does anyone have a list of the available
’Ticket SQL’ commands? Has anyone tried this and been successful? If so,
what did you code? Thanks.

Kenn
LBNL


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

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.22.0/1344 - Release Date: 3/26/2008
8:52 AM


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

Best regards, Ruslan.

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will add
a comment to the parent noting that the prerequisite is now complete, it
will also email the owner of the parent task.

Set the Row count of custom fields by type and or customfield ID. In our
implementation, single select boxes have a row height of 1 (making them
a drop down box) and text areas have a row height of 6, and a specific
multi select is set to 7 so that no scrolling is needed to view its
options.

Default values on custom fields. We modified the code so that the
"description" field in the custom field admin screen is used for the
default value of that custom field. This works regardless of the field
type, so for text, select boxes etc.

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase by
1 for each day past the start date until it is resolved. Tickets with no
start date age with a priority increase of 1 per day.

We modified the “Timeline” module to use Start Date and Due Date as
opposed to Created and Resolved. This is more appropriate for project
management. We also added more verbose titles to the timeline items,
including ticket #'s. This creates a Project Management Gantt style
chart off of any search results where the tickets have at least a Starts
Date.

Most of these are mods/hacks to the source code that we overlayed in the
/local folder. If anyone is interested in the details I will post them
to the list.

-Aaron

Aaron,

What was the solution to get Timeline working? Other people have had the
same problem…

-ToddOn Mon, Mar 31, 2008 at 7:54 PM, Aaron Sallade asallade@ptsowa.org wrote:

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will add
a comment to the parent noting that the prerequisite is now complete, it
will also email the owner of the parent task.

Set the Row count of custom fields by type and or customfield ID. In our
implementation, single select boxes have a row height of 1 (making them
a drop down box) and text areas have a row height of 6, and a specific
multi select is set to 7 so that no scrolling is needed to view its
options.

Default values on custom fields. We modified the code so that the
"description" field in the custom field admin screen is used for the
default value of that custom field. This works regardless of the field
type, so for text, select boxes etc.

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase by
1 for each day past the start date until it is resolved. Tickets with no
start date age with a priority increase of 1 per day.

We modified the “Timeline” module to use Start Date and Due Date as
opposed to Created and Resolved. This is more appropriate for project
management. We also added more verbose titles to the timeline items,
including ticket #'s. This creates a Project Management Gantt style
chart off of any search results where the tickets have at least a Starts
Date.

Most of these are mods/hacks to the source code that we overlayed in the
/local folder. If anyone is interested in the details I will post them
to the list.

-Aaron


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

I was missing JSON and it’s dependencies. CPAN took care of it.

This is for RT 3.6.6

All in all, Timeline was pretty straightforward. I used CPAN for the
RTx::Timeline module, then used CPAN for JSON::Syck. After that I did a
system reboot and all was well. Timeline showed in the UI.

Aaron Sallade’From: Todd Chapman [mailto:todd@chaka.net]
Sent: Monday, March 31, 2008 5:44 PM
To: Aaron Sallade
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Enhancements and workflows that we have added

Aaron,

What was the solution to get Timeline working? Other people have had the
same problem…

-Todd

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will add
a comment to the parent noting that the prerequisite is now complete, it
will also email the owner of the parent task.

Sounds like new variant of, please update with your solution:
http://wiki.bestpractical.com/view/OpenDependantsOnResolve
http://wiki.bestpractical.com/view/OpenTicketOnAllMemberResolve

[snip]

-Aaron

Best regards, Ruslan.

Yes, I modified the OpenDependantsOnResolve. I’ll post my changes.

Aaron Sallade’
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
asallade@ptsowa.orgFrom: Ruslan Zakirov [mailto:ruz@bestpractical.com]
Sent: Monday, March 31, 2008 7:51 PM
To: Aaron Sallade
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Enhancements and workflows that we have added

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will
add
a comment to the parent noting that the prerequisite is now complete,
it
will also email the owner of the parent task.

Sounds like new variant of, please update with your solution:
http://wiki.bestpractical.com/view/OpenDependantsOnResolve
http://wiki.bestpractical.com/view/OpenTicketOnAllMemberResolve

[snip]

-Aaron

Best regards, Ruslan.

My bad, it looks like that change was already in the wiki. Apparently I
used the variation that adds a comment, then combined it with the
Template in contrib. that grabs the last comment and puts it in an email
for resolution.

Aaron Sallade’
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
asallade@ptsowa.orgFrom: Ruslan Zakirov [mailto:ruz@bestpractical.com]
Sent: Monday, March 31, 2008 7:51 PM
To: Aaron Sallade
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Enhancements and workflows that we have added

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will
add
a comment to the parent noting that the prerequisite is now complete,
it
will also email the owner of the parent task.

Sounds like new variant of, please update with your solution:
http://wiki.bestpractical.com/view/OpenDependantsOnResolve
http://wiki.bestpractical.com/view/OpenTicketOnAllMemberResolve

[snip]

-Aaron

Best regards, Ruslan.

Just in case these are of interest to anyone else-

[snip]

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase by
1 for each day past the start date until it is resolved. Tickets with no
start date age with a priority increase of 1 per day.
Several days ago I’ve update RT::Action::LinearEscalate [1] you should
look at it and may be port changes into it and send us patches. This
will be part of the RT 3.8.0

[snip]

-Aaron

[1] http://search.cpan.org/~ruz/RT-Action-LinearEscalate-0.06/lib/RT/Action/LinearEscalate.pm

Best regards, Ruslan.

I tried to create a new page on the wiki, but got an apache error :frowning:

If anyone else would like to give it a go, feel free.

This is a mod to the RT/Action/EscalatePriority.pm

It will escalate priority towards Start Date instead of Due Date.
Tickets with no Start Date will increase in Priority by 1 per day.
Tickets that reach Final Priority will continue to increase by 1 per
day.

BEGIN BPS TAGGED BLOCK {{{

COPYRIGHT:

This software is Copyright © 1996-2007 Best Practical Solutions, LLC

jesse@bestpractical.com

(Except where explicitly superseded by other copyright notices)

LICENSE:

This work is made available to you under the terms of Version 2 of

the GNU General Public License. A copy of that license should have

been provided with this software, but in any event can be snarfed

from www.gnu.org.

This work is distributed in the hope that it will be useful, but

WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

General Public License for more details.

You should have received a copy of the GNU General Public License

along with this program; if not, write to the Free Software

Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA

02110-1301 or visit their web page on the internet at

http://www.gnu.org/copyleft/gpl.html.

CONTRIBUTION SUBMISSION POLICY:

(The following paragraph is not intended to limit the rights granted

to you to modify and distribute this software under the terms of

the GNU General Public License and is only of importance to you if

you choose to contribute your changes and enhancements to the

community by submitting them to Best Practical Solutions, LLC.)

By intentionally submitting any modifications, corrections or

derivatives to this work, or any other work intended for use with

Request Tracker, to Best Practical Solutions, LLC, you confirm that

you are the copyright holder for those contributions and you grant

Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,

royalty-free, perpetual, license to use, copy, create derivative

works based on those contributions, and sublicense and distribute

those contributions and any derivatives thereof.

END BPS TAGGED BLOCK }}}

=head1 NAME

RT::Action::EscalatePriority

=head1 DESCRIPTION

EscalatePriority is a ScripAction which is NOT intended to be called
per transaction. It’s intended to be called by an RT escalation tool.
One such tool is called rt-crontool and is located in $RTHOME/bin (see
C<rt-crontool -h> for more details)

EsclatePriority uses the following formula to change a ticket’s
priority:

Priority = Priority +  (( FinalPriority - Priority ) / (

DueDate-Today))

Unless the duedate is past, in which case priority gets bumped straight
to final priority.

In this way, priority is either increased or decreased toward the final
priority
as the ticket heads toward its due date.

=cut

package RT::Action::EscalatePriority;
require RT::Action::Generic;

use strict;
use vars qw/@ISA/;
@ISA=qw(RT::Action::Generic);

#Do what we need to do and send it out.

#What does this type of Action does

{{{ sub Describe

sub Describe {
my $self = shift;
return (ref $self . " will move a ticket’s priority toward its final
priority.");
}

}}}

{{{ sub Prepare

sub Prepare {
my $self = shift;

if ($self->TicketObj->Priority() ==

$self->TicketObj->FinalPriority()) {
# no update necessary.
$self->{‘prio’} = ($self->TicketObj->Priority + 1);
return 1;
}
elsif ($self->TicketObj->Priority() >
$self->TicketObj->FinalPriority()) {
# no update necessary.
$self->{‘prio’} = ($self->TicketObj->Priority + 1);
return 1;
}

#compute the number of days until the ticket is due
my $due = $self->TicketObj->StartsObj();


# If we don't have a due date, adjust the priority by one
# until we hit the final priority
if ($due->Unix() < 1) {
if ( $self->TicketObj->Priority > $self->TicketObj->FinalPriority ){
    $self->{'prio'} = ($self->TicketObj->Priority + 1);
    return 1;
}
elsif ( $self->TicketObj->Priority < $self->TicketObj->FinalPriority

){
$self->{‘prio’} = ($self->TicketObj->Priority + 1);
return 1;
}
# otherwise the priority is at the final priority. we don’t need to
# Continue
else {
$self->{‘prio’} = ($self->TicketObj->Priority + 1);
return 1;
}
}

# we've got a due date. now there are other things we should do
else { 
my $diff_in_seconds = $due->Diff(time());    
my $diff_in_days = int( $diff_in_seconds / 86400);    

#if we haven't hit the due date yet
if ($diff_in_days > 0 ) {    
    
    # compute the difference between the current priority and the
    # final priority
    
    my $prio_delta = $self->TicketObj->FinalPriority() -

$self->TicketObj->Priority;

    my $inc_priority_by = int( $prio_delta / $diff_in_days );
    
    #set the ticket's priority to that amount
    $self->{'prio'} = $self->TicketObj->Priority + $inc_priority_by;
    
}
#if $days is less than 1, set priority to final_priority
else {    
    $self->{'prio'} = $self->TicketObj->FinalPriority();
}


}
return 1;

}

}}}

sub Commit {
my $self = shift;
my ($val, $msg) = $self->TicketObj->SetPriority($self->{‘prio’});

unless ($val) {
$RT::Logger->debug($self . " $msg\n");
}
}

eval “require RT::Action::EscalatePriority_Vendor”;
die $@ if ($@ && $@ !~ qr{^Can’t locate
RT/Action/EscalatePriority_Vendor.pm});
eval “require RT::Action::EscalatePriority_Local”;
die $@ if ($@ && $@ !~ qr{^Can’t locate
RT/Action/EscalatePriority_Local.pm});

1;

Aaron Sallade’From: Ruslan Zakirov [mailto:ruz@bestpractical.com]
Sent: Monday, March 31, 2008 8:29 PM
To: Aaron Sallade
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Enhancements and workflows that we have added

Just in case these are of interest to anyone else-

[snip]

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase
by
1 for each day past the start date until it is resolved. Tickets with
no
start date age with a priority increase of 1 per day.
Several days ago I’ve update RT::Action::LinearEscalate [1] you should
look at it and may be port changes into it and send us patches. This
will be part of the RT 3.8.0

[snip]

-Aaron

[1]
http://search.cpan.org/~ruz/RT-Action-LinearEscalate-0.06/lib/RT/Action/
LinearEscalate.pm

Best regards, Ruslan.

Aaron,

We are VERY interested in what you have developed. Whether or not you 

post to the list, please send us what you have. It will be extremely
appreciated. Also, do you have anything that increases the box size of a
free-test CF?. Thanks in advance.

Kenn
LBNLOn 3/31/2008 4:54 PM, Aaron Sallade wrote:

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will add
a comment to the parent noting that the prerequisite is now complete, it
will also email the owner of the parent task.

Set the Row count of custom fields by type and or customfield ID. In our
implementation, single select boxes have a row height of 1 (making them
a drop down box) and text areas have a row height of 6, and a specific
multi select is set to 7 so that no scrolling is needed to view its
options.

Default values on custom fields. We modified the code so that the
"description" field in the custom field admin screen is used for the
default value of that custom field. This works regardless of the field
type, so for text, select boxes etc.

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase by
1 for each day past the start date until it is resolved. Tickets with no
start date age with a priority increase of 1 per day.

We modified the “Timeline” module to use Start Date and Due Date as
opposed to Created and Resolved. This is more appropriate for project
management. We also added more verbose titles to the timeline items,
including ticket #'s. This creates a Project Management Gantt style
chart off of any search results where the tickets have at least a Starts
Date.

Most of these are mods/hacks to the source code that we overlayed in the
/local folder. If anyone is interested in the details I will post them
to the list.

-Aaron


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

Kenneth Crocker wrote:

Aaron,

We are VERY interested in what you have developed. Whether or not you
post to the list, please send us what you have. It will be extremely
appreciated. Also, do you have anything that increases the box size of a
free-test CF?. Thanks in advance.
If you use Firefox there is an extension which does that, its called:
Resizable Form Fields
I don’t have the url handy but googling for it or searching on the addon
site of Firefox will turn it up.

Joop

Joop,

Thanks. I'll check that out.

Kenn
LBNLOn 4/1/2008 10:11 AM, Joop van de Wege wrote:

Kenneth Crocker wrote:

Aaron,

We are VERY interested in what you have developed. Whether or not 

you post to the list, please send us what you have. It will be
extremely appreciated. Also, do you have anything that increases the
box size of a free-test CF?. Thanks in advance.
If you use Firefox there is an extension which does that, its called:
Resizable Form Fields
I don’t have the url handy but googling for it or searching on the addon
site of Firefox will turn it up.

Joop

For the width of freetext boxes etc, as well as the height -

Copy your/share/html/elements/EditCustomField to
local/html/elements/EditCustomField and add the following changes.

Put this after
$EditComponent = “EditCustomField$Type” unless
$m->comp_exists($EditComponent);

My custom field formatting overlays===============

If ($Type eq “Text”) {
$Rows = 6;
$Columns = 20;
} elsif ($Type eq “Wikitext”) {
$Rows = 8;
$Columns = 15;
} elsif ($Type eq “Select”) {
$Rows = 1;
$Columns = 10;
}

CustomField id # 14 is the specific ID of a field that I want to have

unique display
If (CustomField->Id == 14) {
$Rows = 7;
}

End of my overlay=================================

Aaron Sallade’
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
asallade@ptsowa.orgFrom: Kenneth Crocker [mailto:KFCrocker@lbl.gov]
Sent: Tuesday, April 01, 2008 9:25 AM
To: Aaron Sallade
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Enhancements and workflows that we have added

Aaron,

We are VERY interested in what you have developed. Whether or

not you
post to the list, please send us what you have. It will be extremely
appreciated. Also, do you have anything that increases the box size of a

free-test CF?. Thanks in advance.

Kenn
LBNL

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will
add
a comment to the parent noting that the prerequisite is now complete,
it
will also email the owner of the parent task.

Set the Row count of custom fields by type and or customfield ID. In
our
implementation, single select boxes have a row height of 1 (making
them
a drop down box) and text areas have a row height of 6, and a specific
multi select is set to 7 so that no scrolling is needed to view its
options.

Default values on custom fields. We modified the code so that the
"description" field in the custom field admin screen is used for the
default value of that custom field. This works regardless of the field
type, so for text, select boxes etc.

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase
by
1 for each day past the start date until it is resolved. Tickets with
no
start date age with a priority increase of 1 per day.

We modified the “Timeline” module to use Start Date and Due Date as
opposed to Created and Resolved. This is more appropriate for project
management. We also added more verbose titles to the timeline items,
including ticket #'s. This creates a Project Management Gantt style
chart off of any search results where the tickets have at least a
Starts
Date.

Most of these are mods/hacks to the source code that we overlayed in
the
/local folder. If anyone is interested in the details I will post them
to the list.

-Aaron


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

Aaron,

I just put in those changes and I get a syntax error on $Type. The 

error message says the folowing:

"Error during compilation of
/apps/rt/rt-3.6.4/local/html/Elements/EditCustomField:
syntax error at /apps/rt/rt-3.6.4/local/html/Elements/EditCustomField
line 79, near ") {"
Global symbol “$Columns” requires explicit package name at
/apps/rt/rt-3.6.4/local/html/Elements/EditCustomField line 81,
line 361.
syntax error at /apps/rt/rt-3.6.4/local/html/Elements/EditCustomField
line 82, near "} elsif"
Global symbol “$Type” requires explicit package name at
/apps/rt/rt-3.6.4/local/html/Elements/EditCustomField line 82,
line 361.
Global symbol “$Rows” requires explicit package name at
/apps/rt/rt-3.6.4/local/html/Elements/EditCustomField line 83,
line 361.
Global symbol “$Columns” requires explicit package name at
/apps/rt/rt-3.6.4/local/html/Elements/EditCustomField line 84,
line 361.
syntax error at /apps/rt/rt-3.6.4/local/html/Elements/EditCustomField
line 85, near “;
}”

I'm not sure why it doesn't like $Type. Any ideas? I'm not real 

experienced at perl. Just learning. Thanks.

Kenn
LBNLOn 4/1/2008 11:47 AM, Aaron Sallade wrote:

For the width of freetext boxes etc, as well as the height -

Copy your/share/html/elements/EditCustomField to
local/html/elements/EditCustomField and add the following changes.

Put this after
$EditComponent = “EditCustomField$Type” unless
$m->comp_exists($EditComponent);

My custom field formatting overlays===============

If ($Type eq “Text”) {
$Rows = 6;
$Columns = 20;
} elsif ($Type eq “Wikitext”) {
$Rows = 8;
$Columns = 15;
} elsif ($Type eq “Select”) {
$Rows = 1;
$Columns = 10;
}

CustomField id # 14 is the specific ID of a field that I want to have

unique display
If (CustomField->Id == 14) {
$Rows = 7;
}

End of my overlay=================================

Aaron Sallade’
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
asallade@ptsowa.org

-----Original Message-----
From: Kenneth Crocker [mailto:KFCrocker@lbl.gov]
Sent: Tuesday, April 01, 2008 9:25 AM
To: Aaron Sallade
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Enhancements and workflows that we have added

Aaron,

We are VERY interested in what you have developed. Whether or
not you
post to the list, please send us what you have. It will be extremely
appreciated. Also, do you have anything that increases the box size of a

free-test CF?. Thanks in advance.

Kenn
LBNL

On 3/31/2008 4:54 PM, Aaron Sallade wrote:

Just in case these are of interest to anyone else-

Added a scrip and template that adds a reply to a DependedOnBy Parent
ticket when the child is resolved. Resolving a sub task (child) will
add
a comment to the parent noting that the prerequisite is now complete,
it
will also email the owner of the parent task.

Set the Row count of custom fields by type and or customfield ID. In
our
implementation, single select boxes have a row height of 1 (making
them
a drop down box) and text areas have a row height of 6, and a specific
multi select is set to 7 so that no scrolling is needed to view its
options.

Default values on custom fields. We modified the code so that the
"description" field in the custom field admin screen is used for the
default value of that custom field. This works regardless of the field
type, so for text, select boxes etc.

Altered Priority and Aging. We modified aging so that it ages towards
Starts instead of Due. We also made it so that priority will increase
by
1 for each day past the start date until it is resolved. Tickets with
no
start date age with a priority increase of 1 per day.

We modified the “Timeline” module to use Start Date and Due Date as
opposed to Created and Resolved. This is more appropriate for project
management. We also added more verbose titles to the timeline items,
including ticket #'s. This creates a Project Management Gantt style
chart off of any search results where the tickets have at least a
Starts
Date.

Most of these are mods/hacks to the source code that we overlayed in
the
/local folder. If anyone is interested in the details I will post them
to the list.

-Aaron


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