Customizing the column mapRE: Time left... RE: Display time worked in search results in hours only

I do see in the code how to display the TimeLeft in minutes. Now I wonder if I want to modify the file in ./share/html/Elements/RT__Ticket/ColumnMap. Should this be done in a local callback? The example given is for adding a new search column but in this case I just want to override what is there for existing columns

I’d actually like to modify TimeEstimated, TimeWorked, and TimeLeft to display in hours.

Thanks.

KeithFrom: Jim Brandt [mailto:jbrandt@bestpractical.com]
Sent: Monday, February 01, 2016 2:04 PM
To: Keith Creasy; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time left… RE: Display time worked in search results in hours only

Hi Keith,

Yes, we read the mail that comes to the various lists and other places people post questions about RT. Unfortunately we don’t have time to reply to all of the questions users have, but the rt-users list has a great volunteer community and I see you got some replies.

Looking below, I think you found the right section of the code. I think the best approach would be to add some column maps with the formats you want. The process to do that is documented here:

https://bestpractical.com/docs/rt/4.2/customizing/search_result_columns.html

Good luck!
Jim

I do see in the code how to display the TimeLeft in minutes. Now I wonder if I want to modify the file in ./share/html/Elements/RT__Ticket/ColumnMap.

I wouldn’t.

Should this be done in a local callback?

This is what I’d do.

-m

If you modify the code in place, your changes will get overwritten when
you upgrade (even a minor upgrade). In general, options for changes are:

  1. Change in place. Will get squashed on upgrade, so keep a copy
    somewhere and make a note to reapply after upgrades.

  2. Create a local directory in your rt directory and override (duplicate
    the directory structure and file under local).

  3. Use callbacks which add to the code without overriding.

  4. Create an extension using the techniques above to manage the changes
    in a separate package (and possibly share with others).

Any of the above will work for making custom changes. I think an
extension that allows you to set a preferred format via config and then
uses that over the default in DurationAsString would be very useful. (RT
features often begin life as extensions, then get pulled into core.)On 2/1/16 3:17 PM, Matt Zagrabelny wrote:

On Mon, Feb 1, 2016 at 2:08 PM, Keith Creasy kcreasy@aph.org wrote:

I do see in the code how to display the TimeLeft in minutes. Now I wonder if I want to modify the file in ./share/html/Elements/RT__Ticket/ColumnMap.
I wouldn’t.

Should this be done in a local callback?

This is what I’d do.

-m


RT 4.4 and RTIR Training Sessions (http://bestpractical.com/services/training.html)

  • Hamburg Germany March 14 & 15, 2016

Thanks, Jim, for enumerating options. I’m not sure where we’ll go with this yet. Just for the time being I think we are going to use the REST API to generate the specific report we need and then work on making RT behave more as we think it should.

I still think it makes no sense at all to convert fields that are entered in minutes into calendar units - years, months, days. It just doesn’t seem useful. There probably was some logic behind it.

KeithFrom: Jim Brandt [mailto:jbrandt@bestpractical.com]
Sent: Tuesday, February 02, 2016 1:21 PM
To: Matt Zagrabelny; Keith Creasy
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Customizing the column mapRE: Time left… RE: Display time worked in search results in hours only

If you modify the code in place, your changes will get overwritten when you upgrade (even a minor upgrade). In general, options for changes are:

  1. Change in place. Will get squashed on upgrade, so keep a copy somewhere and make a note to reapply after upgrades.

  2. Create a local directory in your rt directory and override (duplicate the directory structure and file under local).

  3. Use callbacks which add to the code without overriding.

  4. Create an extension using the techniques above to manage the changes in a separate package (and possibly share with others).

Any of the above will work for making custom changes. I think an extension that allows you to set a preferred format via config and then uses that over the default in DurationAsString would be very useful. (RT features often begin life as extensions, then get pulled into core.)