Re: [rt-users] Hours Worked
Chaitanya Veludandi wrote: Hi, Is there a way to calculate Hours Worked (using Business Hours) based on the difference betwee Resolved Time and Created Time and then move it to a custom Field? Posted to this list less than 24 hours ago: But do you know if it is possible for RT (I couldn't find it when I searched Google) to automatically enter the time worked based on the time elapsed between when the ticket was opened and when it was updated? I guess(?) that if an issue remained unresolved and the customer called back it would have to add time to said ticket on each update? I will keep searching for this on my own, but figured it couldn't hurt to ask. I don't see why not. I might be wrong about the *best* way to do it, but it certainly seems you could add a custom scrip action to do it. Pseudocode: On Ticket-Update, Ticket-Worked = Ticket-Updated() - Ticket-Created() Although, you might need to convert the times into Unix time, then do the sums and then convert back again. -- Kind Regards, ___ Mike Peachey, IT Tel: +44 (0) 114 281 2655 Fax: +44 (0) 114 281 2951 Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK http://www.jennic.com Confidential ___ ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Tasks
Thanks for the tip. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ruslan Zakirov Sent: Thursday, February 07, 2008 9:51 PM To: Kenneth Crocker Cc: Candelario, Bill; rt-users@lists.bestpractical.com Subject: Re: [rt-users] Tasks Bill, Kenneth's example is cool and works, however it notifies old owner when people change owner except when old owner is nobody. To notify new owner you should read http://wiki.bestpractical.com/view/NotifyOwner . On Feb 8, 2008 2:03 AM, Kenneth Crocker [EMAIL PROTECTED] wrote: Bill, Keep in mind, that a notify .. will not send anything to whomever if whomever is the person making the change. As to a scrip to notify of owner change, I use the following scrip/template code: # Scrip code # check transaction as an owner change; no spam for nobody # my $trans = $self-TransactionObj; return 0 unless $trans-Field eq 'Owner'; return 1 unless $trans-OldValue == $RT::Nobody-Id; # Template code To:{ my $Old_Owner; $Old_Owner = RT::User-new($RT::System); $Old_Owner-Load( $Transaction-OldValue ); $Old_Owner-EmailAddress(); } Subject: Request Titled: {$Ticket-Subject} has a new owner! -- --- TICKET INFORMATION: Ticket Queue : {$Ticket-QueueObj-Name} Ticket Number : {$Ticket-id} Ticket Subject: {$Ticket-Subject} Ticket Description: { return $Ticket-FirstCustomFieldValue('Description'); } Ticket Priority is: {$Ticket-Priority} Ticket Created by: {$Ticket-CreatorObj-Name} Ticket Now Owned by: {$Ticket-OwnerObj-Name} I hope this helps. Kenn LBNL On 2/7/2008 1:24 PM, Candelario, Bill wrote: Hi, Is there a way to create Queue called Tasks and when creating a task and assigning it to an owner, that it actually emails the owner of the ticket. I tried using the OnCreate..NotifyOwner scrip but it didn't work. Any suggestions? I'm using version 3.6.4 Thanks, Bill ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com -- Best regards, Ruslan. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] AdminCcs can reply even without ReplyToTicket right?
My RightsMatrix RT extension will tell you exactly how an individual got a right. http://search.cpan.org/author/HTCHAPMAN/RTx-RightsMatrix-0.03.00/lib/RTx/RightsMatrix.pm On 2/7/08, Ole Craig [EMAIL PROTECTED] wrote: On Fri, 2008-02-08 at 03:06 +0300, Ruslan Zakirov wrote: On Feb 8, 2008 2:45 AM, Ole Craig [EMAIL PROTECTED] wrote: (RT 3.6.0) Do AdminCC users automatically get the ability to correspond with the Requestor, even when the ReplyToTicket right is de-selected for the role? If so, why is it selectable at all? No, they don't get unless they have this right via other roles or directly via group membership. I don't remember any bug fix that can be close to the problem you're describing, but 3.6.0 had been released on Jun 15 2006. It's very-very old. Yup. It's been in production since then, and I've been busy building a support team and haven't had time to upgrade. I have a window scheduled for early March. Glad to hear that the right does control; obviously I've missed an inheritance somewhere. I'll go looking, thanks. -- /Ole Craig Security Engineer Team lead, customer support [EMAIL PROTECTED] 303-381-3802 main support line 303-381-3824 my voicemail 303-381-3880 fax www.stillsecure.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] How to determine RTFM version?
On Fri, Feb 08, 2008 at 09:38:03AM -0500, Jason Fenner wrote: I have a quick question that I hope someone can assist me with. We have been using RTFM with our RT installation for quite some time. Recently, I went to check what version of RTFM we were running. I can't seem to be able to determine what version is currently installed and running. Can anyone point me in the direction of where I could look to find the version number of the installed and running version? local/lib/RT/FM.pm: our $VERSION = '2.2.1'; ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] Log in Issues.
I am have some difficulties staying logged in as root with Rt Tracker. I have tried googling my problem but can't seem to find a resolution. I am running Gentoo and my browser (Firefox) has been set to accept all cookies My Apache conf is below: IfDefine PERL VirtualHost *:80 ServerName etcetc DocumentRoot /var/www/rttracker ServerAdmin [EMAIL PROTECTED] AddDefaultCharset UTF-8 IfDefine USERDIR UserDir disabled /IfDefine PerlModule Apache::DBI PerlRequire Location / SetHandler perl-script PerlHandler RT::Mason PerlSetEnv PERL5LIB /usr/lib /Location Directory Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all /Directory /VirtualHost /IfDefine and my Rt_siteconfig.pm is below: Any help on this would be greatly appreciated. -- View this message in context: http://www.nabble.com/Log-in-Issues.-tp15361064p15361064.html Sent from the Request Tracker - User mailing list archive at Nabble.com. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] Transaction not committed issues
I have recently re-installed RT on a new system (rt-3.6.6) I had a previous install of RT (rt-3.6.2) on another system. I am using the same database but a fresh RT install. I am getting the following error in my apache log and can't create anything in RT. [crit]: Transaction not committed. Usually indicates a software fault.Dataloss may have occurred (/usr/local/rt/lib/RT/Interface/Web/Handler.pm:195) I can browse the interface and login fine. Searching the web gets my all kinds of things so here is a summation of all the thinks I have tired and whats installed on my system. perl v5.8.5 CentOS 4.5 MySQL-devel-community-5.0.45-0.rhel4 MySQL-shared-compat-5.0.45-0.rhel4 MySQL-client-community-5.0.45-0.rhel4 MySQL-server-community-5.0.45-0.rhel4 Apache/2.0.52 DBI-1.601 DBD-mysql-4.006 So I have tried a number of things. I have recompiled DBI and DBD .. also moved back to version 4.001 of the DBD-mysql driver. The database is using innodb tables and the innodb engine is available ? I am not sure what else to try ? If anyone has anything please help. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Hours Worked
Hello, I am trying to work on this time worked issue myself and have been trying the following: Condition: On Transaction Action: user defined Template: Global template: Blank Stage: TransactionCreate Custom Condition: blank Custom action preparation code: 1; Custom action cleanup code: $ticket_Worked = ($self-TicketObj-Updated - $self-TicketObj-Created); if ($self-TicketObj-Type eq Correspond || $self-TicketObj-Type eq Comment) { $self-TicketObj-SetTimeWorked ($ticket_Worked); } else { return 0; } Can someone tell me if that looks even remotely correct? I know that Mike has said that we might need to convert times to Unix time and then back again, and I haven't tried that yet, but I also have not even got to see any kind of data go into that field. I was thinking that I might be able to put whatever is returned into a comment or something as well to see if that would work, so I changed the $self-TicketObj-SetTimeWorked to $self-TicketObj-setContent, but I also had nothing returned that I could see. Not really sure where to go from there, hoping that someone has some insight for me (or even a small clue) Greg Evans -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Peachey Sent: Friday, February 08, 2008 12:24 AM To: Chaitanya Veludandi; rt-users@lists.bestpractical.com Subject: Re: [rt-users] Hours Worked Chaitanya Veludandi wrote: Hi, Is there a way to calculate Hours Worked (using Business Hours) based on the difference betwee Resolved Time and Created Time and then move it to a custom Field? Posted to this list less than 24 hours ago: [snip] ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Rights, rights, rights...
On Fri, Feb 08, 2008 at 10:21:03AM -0800, Kenneth Crocker wrote: Jean-Sebastien, Jesse just started up a Library of documentation on ../rt-docs. I have a complete RT Queue Admin guide there. Thanks Kenneth (and Jesse). Just a little question though... ../rt-docs is relative to what? :-) js. -- Jean-Sebastien Morisset, Sr. UNIX Administrator [EMAIL PROTECTED] ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] Why Resolve + Comment?
Hi everyone, I have a small problem with my users... One of them will take ownership of the ticket, work the problem, choose 'Resolve' and write what they did in the text box. This means the requestor doesn't see the summary of work done because it's a comment and not a reply. Is there a reason Resolve defaults to a Comment, and is there a way to change the default to Reply? Thanks, js. -- Jean-Sebastien Morisset, Sr. UNIX Administrator [EMAIL PROTECTED] ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Transaction not committed issues
On Fri, Feb 08, 2008 at 02:00:30PM -0500, Matt Higgins wrote: I have recently re-installed RT on a new system (rt-3.6.6) I had a previous install of RT (rt-3.6.2) on another system. I am using the same database but a fresh RT install. I am getting the following error in my apache log and can't create anything in RT. I'd sort of expect to see something _else_ before that. Anything there? [crit]: Transaction not committed. Usually indicates a software fault.Dataloss may have occurred (/usr/local/rt/lib/RT/Interface/Web/Handler.pm:195) I can browse the interface and login fine. Searching the web gets my all kinds of things so here is a summation of all the thinks I have tired and whats installed on my system. perl v5.8.5 CentOS 4.5 MySQL-devel-community-5.0.45-0.rhel4 MySQL-shared-compat-5.0.45-0.rhel4 MySQL-client-community-5.0.45-0.rhel4 MySQL-server-community-5.0.45-0.rhel4 Apache/2.0.52 DBI-1.601 DBD-mysql-4.006 So I have tried a number of things. I have recompiled DBI and DBD .. also moved back to version 4.001 of the DBD-mysql driver. The database is using innodb tables and the innodb engine is available ? I am not sure what else to try ? If anyone has anything please help. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com -- ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] COndition on customfield change
Alvaro, seems the changes of custom fields are not in table Transactions at NewValue and OldValue but linked from OldReference and NewReference. Nevertheless you can read the values by first checking if the transaction was caused by the special CF like I mentioned before and then you can read old and new value using the TransactionObj like this: $self-TransactionObj-OldValue and $self-TransactionObj-NewValue. I have to admit, I don't know how it works internally but I never really cared because it works for me this way. ;) Give it a try. Munoz, Alvaro wrote: Hi Benjamin, I looked at the wiki and the list before posting, but the problem is that newValue and oldValue attributes are not set in the transaction. +---++--+---+-+---+--+--++--+--+--+-+-+ | id| ObjectType | ObjectId | TimeTaken | Type| Field | OldValue | NewValue | ReferenceType | OldReference | NewReference | Data | Creator | Created | +---++--+---+-+---+--+--++--+--+--+-+-+ | 25207 | RT::Ticket | 188 | 0 | CustomField | 323 | NULL | NULL | RT::ObjectCustomFieldValue | NULL | 6992 | NULL | 12 | 2008-02-08 15:05:39 | +---++--+---+-+---+--+--++--+--+--+-+-+ There should be a way to get those values within the scrip. How does ticket history transaction get those values to print? # Vie. Feb. 08 16:46:20 2008 root - Valor de Fase ha cambiado de 'primera' a 'segunda' Thanks again, Alvaro Muñoz Sánchez Technical Consultant Hewlett Packard Consulting Integration Phone: 628 13 01 36 E-Mail: [EMAIL PROTECTED] P Antes de imprimir piensa en el medio ambiente -Original Message- From: Benjamin Weser [mailto:[EMAIL PROTECTED] Sent: viernes, 08 de febrero de 2008 14:53 To: Munoz, Alvaro Cc: RT Users Subject: Re: [rt-users] COndition on customfield change Alvara, have a look at http://wiki.bestpractical.com/view/Contributions, there are several examples how to read and manipulate the values of CFs via scrips. First you have to look if the transaction was caused by a CF, something like this: unless ( ( $self-TransactionObj-Type eq CustomField $self-TransactionObj-Field == 6 ) || $self-TransactionObj-Type eq Create ) { return 0; } Hint: The 6 equals the id of the CF. Then you can test for OldValue and NewValue. Have a look at the examples mentioned above. Best, Ben Munoz, Alvaro schrieb: Hi there, Is there any way to match a customfiled value change from one specific value to another? Transactions of type CustomField leave NewValue and OldValue to NULL so I just can know that the field has changed but not the old and new values. In the ticket history you can see both values, can i use those values from a scrip condition? Thanks in advance! Alvaro -- -- ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] Every click on a ticket takes 10 seconds
When clicking on a ticket, it takes 10 sec for the page to build up. The left column of the site (the basics, people, more about xxx xxx) builds up in under 1 sec, but the right column and the bottom (reminders, dates, links, history) takes every time 9-10 seconds to show up. Apache log with request time: xxx.xxx.xxx.xxx - - [31/Jan/2008:04:01:27 -0500] GET /Ticket/Display.html?id=5335 HTTP/1.1 200 282977 http://xx.xx/; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 9597932 The box has enough free ram, and is 99% idle. In the MySQL I can see many locks like this: # Query_time: 9 Lock_time: 0 Rows_sent: 1 Rows_examined: 0 SELECT GET_LOCK('Apache-Session-bbe05f8fb2d2792dfb16441a94e7f351', 3600); This locks seems not the be the source of the problem but the consequence. I switched temporarily to file system based sessions, but the behavior was the same. Every click on a ticket took near 10 seconds. The installation holds a few tickets and there are 3 people using it. While the site builds up I can see that libperl.so takes 80% of the CPU time. Versions: OS: CentOS 5 Apache/2.2.3 MySQL 5.0.22 Perl 5.8.8 RT: 3.6.6 (problem existed in 3.6.5 too) SELinux: disabled Could anyone please help me in debugging this problem? Best regards Adalbert -- View this message in context: http://www.nabble.com/Every-click-on-a-ticket-takes-10-seconds-tp15200974p15200974.html Sent from the Request Tracker - User mailing list archive at Nabble.com. ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] COndition on customfield change
Hi there, Is there any way to match a customfiled value change from one specific value to another? Transactions of type CustomField leave NewValue and OldValue to NULL so I just can know that the field has changed but not the old and new values. In the ticket history you can see both values, can i use those values from a scrip condition? Thanks in advance! Alvaro ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Hours Worked
I wrote a mod to the Business::Hours package that lets you subtract one date from another. It's on the wiki as part of something else I posted, but since I don't remember where I'll post it below. It works just like the add_seconds() method, but it subtracts instead. You can either append it to the end of your program or (I think) put it into your RT config file. ## start of code ### Need to add this to Business::Hours so I can count backwards from due date { package Business::Hours; sub sub_seconds { ### This method is hacked version of add_seconds(), written by Gene LeDuc my $self = shift; my $start = shift; my $seconds = shift; # the maximum time after which we stop searching for business hours my $MAXTIME = (30 * 24 * 60 * 60); # 30 days my $first; my $period = (24 * 60 * 60); my $begin = $start - $period; my $hours = new Set::IntSpan; while ($hours-empty or $self-between($hours-first, $start) = $seconds) { if ($begin = $start - $MAXTIME) { return -1; if ($begin = $start - $MAXTIME) { return -1; } $hours = $self-for_timespan(Start = $begin, End = $start); $begin -= $period; } my @elements = reverse elements $hours; $first = $elements[$seconds]; return $first; } 1; #this line is important and will help the module return a true value } ## end of code Regards, Gene At 10:37 PM 2/7/2008, Chaitanya Veludandi wrote: Hi, Is there a way to calculate Hours Worked (using Business Hours) based on the difference betwee Resolved Time and Created Time and then move it to a custom Field? Regards, Chaitanya ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com -- Gene LeDuc, GSEC Security Analyst San Diego State University ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Rights, rights, rights...
On Thu, Feb 07, 2008 at 11:00:04AM -0800, Kenneth Crocker wrote: Jean-Sebastien, It looks better, that's for sure. Let me show what I have, with an explanation for why, and you can take it from there, Obviously, every installation will have it's different infrastructure needs, but on the whole, what I'm doing and (more importantly) WHY will provide more instruction and understanding of how these rights work. I'm absolutely sure that anyone who has used RT with more than 10 queues (especially for technical support) for more than a couple years would be able to show you the same stuff as I'm about to. Here we go: Kenneth, OMG, that's was an amazing reply! Thanks! I implemented just about everything, but had to give Everyone access to create tickets. I hadn't thought of seperating queue owners into regular and admin - it makes perfect sense. It also off-loads the tedious maintenance tasks from myself and the unix guys. :-) I have everything working very nicely, thanks to your help. Now I'm tackling approvals. :-) Thanks again, js. -- Jean-Sebastien Morisset, Sr. UNIX Administrator [EMAIL PROTECTED] ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] COndition on customfield change
Hi Benjamin, I looked at the wiki and the list before posting, but the problem is that newValue and oldValue attributes are not set inthe transaction Alvaro Muñoz Sánchez Technical Consultant Hewlett Packard Consulting Integration Phone: 628 13 01 36 E-Mail: [EMAIL PROTECTED] P Antes de imprimir piensa en el medio ambiente -Original Message- From: Benjamin Weser [mailto:[EMAIL PROTECTED] Sent: viernes, 08 de febrero de 2008 14:53 To: Munoz, Alvaro Cc: RT Users Subject: Re: [rt-users] COndition on customfield change Alvara, have a look at http://wiki.bestpractical.com/view/Contributions, there are several examples how to read and manipulate the values of CFs via scrips. First you have to look if the transaction was caused by a CF, something like this: unless ( ( $self-TransactionObj-Type eq CustomField $self-TransactionObj-Field == 6 ) || $self-TransactionObj-Type eq Create ) { return 0; } Hint: The 6 equals the id of the CF. Then you can test for OldValue and NewValue. Have a look at the examples mentioned above. Best, Ben Munoz, Alvaro schrieb: Hi there, Is there any way to match a customfiled value change from one specific value to another? Transactions of type CustomField leave NewValue and OldValue to NULL so I just can know that the field has changed but not the old and new values. In the ticket history you can see both values, can i use those values from a scrip condition? Thanks in advance! Alvaro -- -- ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] COndition on customfield change
Alvara, have a look at http://wiki.bestpractical.com/view/Contributions, there are several examples how to read and manipulate the values of CFs via scrips. First you have to look if the transaction was caused by a CF, something like this: unless ( ( $self-TransactionObj-Type eq CustomField $self-TransactionObj-Field == 6 ) || $self-TransactionObj-Type eq Create ) { return 0; } Hint: The 6 equals the id of the CF. Then you can test for OldValue and NewValue. Have a look at the examples mentioned above. Best, Ben Munoz, Alvaro schrieb: Hi there, Is there any way to match a customfiled value change from one specific value to another? Transactions of type CustomField leave NewValue and OldValue to NULL so I just can know that the field has changed but not the old and new values. In the ticket history you can see both values, can i use those values from a scrip condition? Thanks in advance! Alvaro ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
[rt-users] Scrip question...Getting there slowly...Time Worked
As has been mentioned I am working on trying to get a time worked scrip up and running. So far everything is going well except for one thing, I can retrieve dates from the ticket without problem and they come through like: 2008-02-08 21:24:49 This seems like a fine format, but once I have 2 of them, I can't figure out how to calculate the difference. It was suggest that I might need to convert them to unix time and back, but I am not sure how to do that. I see that Time::Local could possibly be used or maybe Date::Manip but my admittedly novice Perl skills don't particularly help me out here. Here is the scrip as it sits, and after using RT::Logger-debug it appears that all I need is to get the date difference calculation to work if ($self-TicketObj-Type eq Correspond || $self-TicketObj-Type eq Comment || $self-TicketObj-Type eq ticket) { #This is the part that is not working. my $ticket_Worked = ($self-TicketObj-LastUpdated - $self-TicketObj-Created); #End part that is not working $self-TicketObj-SetTimeWorked($ticket_Worked); } else { return undef; } The other thing that I thought was weird when I looked in my rt.log was that when I would comment on the ticket, the returned result of the if test that I start with was ticket which seems strange to me, but what do I know. Maybe someone could explain that to me as well? Greg Evans Internet Support Hood Canal Communications (360) 898-2481 ext.212 ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com
Re: [rt-users] Scrip question...Getting there slowly...Time Worked
On Feb 9, 2008 2:57 AM, Greg Evans [EMAIL PROTECTED] wrote: following up on my own post to the list...The following code is *mostly* working but there is a GLARING ERROR that makes it unusable Please NOTE THE ABOVE because if you use it as is, it will require a restart of httpd each time you try to update a ticket. #code begin if ($self-TicketObj-Type eq Correspond || $self-TicketObj-Type eq Comment || $self-TicketObj-Type eq ticket) This is wrong. you're mixing transactions' types and tickets' Ticket's type almost always is 'ticket', so this if condition is true all the time. What condition are you using for this scrip? # Why it has to be ticket to work I don't understand yet { # Saw something similar somewhere that I was looking at RT stuff. # Looked like it may work, it does. my $date_update=$self-TicketObj-LastUpdatedObj-Unix; my $date_create=$self-TicketObj-CreatedObj-Unix; my $ticket_check = $self-TicketObj-TimeWorked; #tells us the current value of TimeWorked my $ticket_Worked = (($date_update - $date_create)/60); #time in minutes #this was the problem before and seems to be the problem again!!! $self-TicketObj-SetTimeWorked($ticket_Worked); return 1; } else { return undef; } Here is what happens when I run it as is just a quick copy/paste job of the ticket: Fri Feb 08 15:39:22 2008 gevans - Comments added[Reply] [Comment] Download (untitled) [text/plain 1.2k] On Fri Feb 08 15:37:16 2008, gevans wrote: [snipped] #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '19.1' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '19' to '' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '21.21667' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '21' to '' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '21.21667' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '21' to '' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '21.21667' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '21' to '' ... ... #Fri Feb 08 15:42:39 2008 RT_System - TimeWorked changed from (no value) to '24.48333' #Fri Feb 08 15:42:39 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:39 2008 RT_System - TimeWorked changed from (no value) to '24.48333' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.48333' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' It will continue adding time until you kill httpd. This has got to be something simple that I am missing. At least I think so... Ideas? Thanks, Greg Evans From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Evans Sent: Friday, February 08, 2008 2:09 PM To: rt-users@lists.bestpractical.com Subject: [rt-users] Scrip question...Getting there slowly...Time Worked As has been mentioned I am working on trying to get a time worked scrip up and running. So far everything is going well except for one thing, I can retrieve dates from the ticket without problem and they come through like: 2008-02-08 21:24:49 This seems like a fine format, but once I have 2 of them, I can't figure out how to calculate the difference. It was suggest that I might need to convert them to unix time and back, but I am not sure how to do that. I see that Time::Local could possibly be used or maybe Date::Manip but my admittedly novice Perl skills don't particularly help me out here. Here is the scrip as it sits, and after using RT::Logger-debug it appears that all I need is to get the date difference calculation to work if ($self-TicketObj-Type eq Correspond || $self-TicketObj-Type eq Comment || $self-TicketObj-Type eq ticket) { #This is the part that is not working. my $ticket_Worked =
Re: [rt-users] Scrip question...Getting there slowly...Time Worked
following up on my own post to the list...The following code is *mostly* working but there is a GLARING ERROR that makes it unusable Please NOTE THE ABOVE because if you use it as is, it will require a restart of httpd each time you try to update a ticket. #code begin if ($self-TicketObj-Type eq Correspond || $self-TicketObj-Type eq Comment || $self-TicketObj-Type eq ticket) # Why it has to be ticket to work I don't understand yet { # Saw something similar somewhere that I was looking at RT stuff. # Looked like it may work, it does. my $date_update=$self-TicketObj-LastUpdatedObj-Unix; my $date_create=$self-TicketObj-CreatedObj-Unix; my $ticket_check = $self-TicketObj-TimeWorked; #tells us the current value of TimeWorked my $ticket_Worked = (($date_update - $date_create)/60); #time in minutes #this was the problem before and seems to be the problem again!!! $self-TicketObj-SetTimeWorked($ticket_Worked); return 1; } else { return undef; } Here is what happens when I run it as is just a quick copy/paste job of the ticket: Fri Feb 08 15:39:22 2008 gevans - Comments added[Reply] [Comment] Download (untitled) [text/plain 1.2k] On Fri Feb 08 15:37:16 2008, gevans wrote: [snipped] #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '19.1' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '19' to '' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '21.21667' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '21' to '' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '21.21667' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '21' to '' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from (no value) to '21.21667' #Fri Feb 08 15:39:23 2008 RT_System - TimeWorked changed from '21' to '' ... ... #Fri Feb 08 15:42:39 2008 RT_System - TimeWorked changed from (no value) to '24.48333' #Fri Feb 08 15:42:39 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:39 2008 RT_System - TimeWorked changed from (no value) to '24.48333' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.48333' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from '24' to '' #Fri Feb 08 15:42:40 2008 RT_System - TimeWorked changed from (no value) to '24.5' It will continue adding time until you kill httpd. This has got to be something simple that I am missing. At least I think so... Ideas? Thanks, Greg Evans From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Evans Sent: Friday, February 08, 2008 2:09 PM To: rt-users@lists.bestpractical.com Subject: [rt-users] Scrip question...Getting there slowly...Time Worked As has been mentioned I am working on trying to get a time worked scrip up and running. So far everything is going well except for one thing, I can retrieve dates from the ticket without problem and they come through like: 2008-02-08 21:24:49 This seems like a fine format, but once I have 2 of them, I can't figure out how to calculate the difference. It was suggest that I might need to convert them to unix time and back, but I am not sure how to do that. I see that Time::Local could possibly be used or maybe Date::Manip but my admittedly novice Perl skills don't particularly help me out here. Here is the scrip as it sits, and after using RT::Logger-debug it appears that all I need is to get the date difference calculation to work if ($self-TicketObj-Type eq Correspond || $self-TicketObj-Type eq Comment || $self-TicketObj-Type eq ticket) { #This is the part that is not working. my $ticket_Worked = ($self-TicketObj-LastUpdated - $self-TicketObj-Created); #End part that is not working $self-TicketObj-SetTimeWorked($ticket_Worked); } else { return undef; } The other
[rt-users] Custom date field search
I have created custom date fields of the format ( -mm-dd ). I would like to create a saved search that would return tickets with upcoming dates less than X days from now. the relational syntax Due ' +5 Days' works if I use the standard Due field, but not if I use a CF field ... 'CF.{Ready Date}' '+5 Days' I have multiple dates/fields that I would like to create saved searches against. Any hints / suggestions ? Anyone else doing something similar ? Roy ___ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com