Customizing RT depending upon some condw

Hey team,
I want to customize a queue in RT in such a manner that in certain condition I want to change color of some particular tickets for a some particular queue. FOR example : If a ticket in a particular queue is not assigned to any one for more than 48 hours the color of the ticket should become red and if the resolved date - ticket creation date> 4 days, it should become orange.

Can anyone please let me know, whether it can be done or not?. If it can be done how can I do it like. Do I need to write a code in any file. Or I need to create a scrip in the front end.

Please note: I want to do the customization for only one queue, not for all queues.

Which part of the ticket are you trying to color? The ticket display page or something like the ticket row in a search results table?

I want to color the ticket row(like ticket no. Field of that particular ticket row) . Like when you open the queue, then all the tickets will be shown. In that page… The identified ticket number which met the conditions should be colored.

You could take a look at this extension:

And maybe use it or get an idea for what kind of code you would need to write from it. I believe you could have a cron-job that updates a custom field(s) based on your criteria mentioned

If a ticket in a particular queue is not assigned to any one for more than 48 hours the color of the ticket should become red and if the resolved date - ticket creation date> 4 days, it should become orange.

Then do coloring based on the value of this custom field(s).

Can you please give me a brief idea that where to code it, i mean in which path.

Is it possible to create a scrip with the desired condition in the frontend and apply the scrip to the particular queue.

scrips only fire on an event like create or update so they will not work on something like page load. I suggested having a cronjob that updates custom fields:

https://docs.bestpractical.com/rt/4.4.4/rt-crontool.html

Then have the extension posted above color ticket rows based on the values of these custom fields.

Hi Craig,
Could you please let me know if the extension exists on cpan. Please let me know from where I can download it and edit it and the process to install and configure in siteconfig.pm file.

Hi Craig,
Coud you please tell e the above details. Thanks!!

You will need to do some custom work in order to get the exact behavior you are looking for I posted some links to documentation and some existing extension that can get you started. I don’t think there is a work straight out of the box option though.

Hi Craig,
Can I customize this extension for only one queue? If yes , can you please give me some idea that how to customize so that, all the other queues will not reflect except that particular queue.

If you are using the approach of coloring ticket rows based off of a custom field value, then I believe only applying the custom field(s) to one queue would do the trick. I haven’t looked at the code for the extension linked above but I believe this is supported. The trickier part will be setting up a cronjob using the rt-crontool that updates this custom field(s) based on owner or resolve date of the tickets in the queue in question,

Ok thanks Craig. This information is helpful. Let me check first in the extension code that where I can filter it for only one queue.

Regard,
Sudeepta

Hi Craig,
Just confused a little bit. Can the feature be achieved by only setting the cron tool or by only using the extension. Or you mean to say combinely cron tool and the extension can give us the feature ?

Hey Craig,

Any suggestion…??

Regards,
Sudeepta

The rt-crontool is what you would use in order to update tickets (I suggested a custom field that determines the color of the ticket row on search results) then the extension mentioned earlier is what does the coloring (In my example based on the value of the custom field being updated by the crontool).

You can search for tickets in question using the RT::Search::FromSQL search option and then you will need a custom action module most likely to update the custom field. Then the config hash for the extension should coincide with how your action module updates:

Set($SearchResult_HighlightOnCFCondition, [ { "conditions" => { "MyColorCustomField" => "red" }, "color" => "red" }, { "conditions" => { "MyColorCustomField" => "orange" }, "color" => "orange" },

So to answer your question yes you will need to combine both of these tools in order to achieve the result you want.

The other option is to investigate how the extension does the color changing logic and write some code that works specifically for your use case.