DueDateInBusinessHours not working

Hi Folks,
Please find below the scrip and error log file which I got while executing the scrip:

Description: Business Hours

Condition: On Create

Action: User Defined

Template: Global template: Blank

Stage: TransactionCreate

Custom condition:

Custom action preparation code:
return 1;

Custom action cleanup code:
my $duedate = RT::Date->new($RT::SystemUser);
my $hoursuntildue = 4;
use Business::Hours;
my $hours = Business::Hours->new();
my $curtime = time;
my $bus_hours_duetime = $hours->add_seconds ($curtime, ($hoursuntildue6060));
$duedate->Set(Format=>‘unix’, Value=>$bus_hours_duetime);
$self->TicketObj->SetDue($duedate->ISO);
return 1;

Error Log File
[Tue Nov 17 07:24:05 2009] [error]: Scrip 117 Commit failed: Can’t locate Business/Hours.pm in @INC (@INC contains: / usr/local/lib/rt3/lib /usr/local/lib/rt3/plugins/RT-Extension-CustomField-Checkbox/lib /usr/lib/perl5/vendor_perl/5.1 0.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl 5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . /etc/httpd) at (eval 482) line 3.

So I pasted the BusinessHours.pm file from the CPAN org in the RT folder but its still givin the same error.What should I do access this package class ? Or is anything wrong in the placing of the file BusinessHours.pm in RT folder? Any help?

Regards,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

Hi Tony,
have you installed the the CPAN Module BUSINESS::HOURS ??

I think copy this to RT folder is not the correct way.

Normally: perl -MCPAN -e ‘install Business::Hours’ should fix your problem

Torsten

Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius (Stellv.), Reiner Heiken (Stellv.), Bruno Mang, Alfred Manke, Christian Marnetté (Stellv.), Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael Kuehne

-----Urspruengliche Nachricht-----Von: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] Im Auftrag von Tony John , Bangalore
Gesendet: Dienstag, 17. November 2009 09:31
An: rt-users@lists.bestpractical.com
Betreff: [rt-users] DueDateInBusinessHours not working

Hi Folks,
Please find below the scrip and error log file which I got while executing the scrip:

Description: Business Hours

Condition: On Create

Action: User Defined

Template: Global template: Blank

Stage: TransactionCreate

Custom condition:

Custom action preparation code:
return 1;

Custom action cleanup code:
my $duedate = RT::Date->new($RT::SystemUser); my $hoursuntildue = 4; use Business::Hours; my $hours = Business::Hours->new(); my $curtime = time; my $bus_hours_duetime = $hours->add_seconds ($curtime, ($hoursuntildue6060)); $duedate->Set(Format=>‘unix’, Value=>$bus_hours_duetime); $self->TicketObj->SetDue($duedate->ISO);
return 1;

Error Log File
[Tue Nov 17 07:24:05 2009] [error]: Scrip 117 Commit failed: Can’t locate Business/Hours.pm in @INC (@INC contains: / usr/local/lib/rt3/lib /usr/local/lib/rt3/plugins/RT-Extension-CustomField-Checkbox/lib /usr/lib/perl5/vendor_perl/5.1 0.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl 5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . /etc/httpd) at (eval 482) line 3.

So I pasted the BusinessHours.pm file from the CPAN org in the RT folder but its still givin the same error.What should I do access this package class ? Or is anything wrong in the placing of the file BusinessHours.pm in RT folder? Any help?

Regards,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.

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

Hi ,
Im trying to update a customfiled value using a scrip but evrytime I does it I gets this error "is no longer a value for custom field value ".Any help?

Regards,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

Tony,

A couple of questions first:

  1. Does the Custom Field have Categories?
  2. Does the Custom Field actually get updated with that value,
    regardless of error message?
  3. what does your scrip code look like?

I can’t offer suggestions to code I cannot see.

Kenn
LBNLOn 11/17/2009 9:52 AM, Tony John , Bangalore wrote:

Hi ,
Im trying to update a customfiled value using a scrip but evrytime I does it I gets this error "is no longer a value for custom field value ".Any help?

Regards,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.



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

Hi,
1.Custom field is set as Select a value

  1. Below mentioned is the history of actions
    Tue Nov 17 12:35:38 2009 Rukmangb - Deal Id 111 added

Tue Nov 17 12:35:38 2009 Rukmangb - Brand 111 added

Tue Nov 17 12:35:39 2009 RT_System - CI Ticket State CI New changed to CI Entry

Tue Nov 17 12:35:39 2009 Rukmangb - CI Ticket State CI Entry changed to CI New

Tue Nov 17 12:35:39 2009 RT_System - CI Ticket State CI New changed to CI Entry

Tue Nov 17 12:35:39 2009 Rukmangb - CI Ticket State CI Entry deleted

Custom condition:
return 0 unless ($self->TicketObj->FirstCustomFieldValue(‘Deal Id’) ne “” and $self->TicketObj->FirstCustomFieldValue(‘Brand’) ne “” and
$self->TicketObj->FirstCustomFieldValue(‘CI Ticket State’) eq “CI New”);
return 1;

Custom preparation code :
Return 1;

Custom Action clean up code :
my( $st, $msg ) = $self->TicketObj->AddCustomFieldValue(
Field => 13,
Value => “CI Entry”,
RecordTransaction => 1);
return 1;

Regards,
Tony JohnFrom: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Tuesday, November 17, 2009 11:49 PM
To: Tony John , Bangalore
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Error :is no longer a value for custom field

Tony,

A couple of questions first:

  1. Does the Custom Field have Categories?
  2. Does the Custom Field actually get updated with that value,
    regardless of error message?
  3. what does your scrip code look like?

I can’t offer suggestions to code I cannot see.

Kenn
LBNL

Tony,

It looks like you’re doing this on any create or modify transaction. So
I’ll assume you’re happy with your condition.
This is the way I would write the action:

Custom Prep Code:

Set base values

my $ticket = $self->TicketObj;
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $cf_name = “WhateverItIs”;
my $cf_value = “CI Entry”;

Update Custom Field

$cf_obj->LoadByName( Name => $cf_name );
$RT::Logger->debug( “Loaded $cf_obj->Name = “. $cf_obj->Name() .”\n” );
$ticket->AddCustomFieldValue( Field=>$cf_obj, Value=>$cf_value,
RecordTransaction=>0 );

return 1;

Custom Cleanup Code:
return 1;

I Like to use $RT::Sysytemuser so I won’t have a problem with privileges
on a Custom Field.
I also like to specify an actual “NAME”. That way whenever I have to
debug the code, I know what the field is. I might not remember what ID
13 is.
I also like to do this in the prep code. You never know if you might
create another scrip that depends on this value being set BEFORE the
transaction has completed. This would be if you have several scrips that
run in “Batch” sequence.

Anyway, I hope this helps.

Kenn
LBNLOn 11/17/2009 10:27 AM, Tony John , Bangalore wrote:

Hi,
1.Custom field is set as Select a value

  1. Below mentioned is the history of actions
    Tue Nov 17 12:35:38 2009 Rukmangb - Deal Id 111 added

Tue Nov 17 12:35:38 2009 Rukmangb - Brand 111 added

Tue Nov 17 12:35:39 2009 RT_System - CI Ticket State CI New changed to CI Entry

Tue Nov 17 12:35:39 2009 Rukmangb - CI Ticket State CI Entry changed to CI New

Tue Nov 17 12:35:39 2009 RT_System - CI Ticket State CI New changed to CI Entry

Tue Nov 17 12:35:39 2009 Rukmangb - CI Ticket State CI Entry deleted

Custom condition:
return 0 unless ($self->TicketObj->FirstCustomFieldValue(‘Deal Id’) ne “” and $self->TicketObj->FirstCustomFieldValue(‘Brand’) ne “” and
$self->TicketObj->FirstCustomFieldValue(‘CI Ticket State’) eq “CI New”);
return 1;

Custom preparation code :
Return 1;

Custom Action clean up code :
my( $st, $msg ) = $self->TicketObj->AddCustomFieldValue(
Field => 13,
Value => “CI Entry”,
RecordTransaction => 1);
return 1;

Regards,
Tony John

-----Original Message-----
From: Ken Crocker [mailto:kfcrocker@lbl.gov]
Sent: Tuesday, November 17, 2009 11:49 PM
To: Tony John , Bangalore
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Error :is no longer a value for custom field

Tony,

A couple of questions first:

  1. Does the Custom Field have Categories?
  2. Does the Custom Field actually get updated with that value,
    regardless of error message?
  3. what does your scrip code look like?

I can’t offer suggestions to code I cannot see.

Kenn
LBNL

On 11/17/2009 9:52 AM, Tony John , Bangalore wrote:

Hi ,
Im trying to update a customfiled value using a scrip but evrytime I does it I gets this error "is no longer a value for custom field value ".Any help?

Regards,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.



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

Hi ,

I’m trying to set the custom filed values of child ticket using a Template but it fails to set the values in the Child Ticket.Please find below the Template used for Ticket creation and setting the value:

Template
===Create-Ticket: Child
Queue: 20
Status: new
Parents: TOP
Type: ticket
Refers-To: {$Tickets{‘TOP’}->Id()}
Content:
{
my $OUT;
my $ticket = $Tickets{‘TOP’};
my $agency=$ticket->FirstCustomFieldValue(‘Agency’);
$OUT = “Agency: $agency\n”;
$OUT;
}
ENDOFCONTENT

Here Im trying to extract a value from the Custom Field of the Parent ticket, which im trying to assign to a Custom Field 'Agency" in the Child Tickets. But the Custom Field value remains blank.

Log File
[Wed Nov 18 08:44:49 2009] [debug]: In CreateByTemplate (/usr/lib/perl5/vendor_perl/5.10.0/RT/Action/CreateTickets.pm:345)
[Wed Nov 18 08:44:49 2009] [debug]: Workflow: processing create-Child of RT::Ticket=HASH(0xbcb05994) (/usr/lib/perl5/vendor_perl/5.10.0/RT/Action/CreateTickets.pm:360)
[Wed Nov 18 08:44:49 2009] [debug]: Workflow: evaluating
Queue: 20
Status: new
Parents: TOP
Type: ticket
Refers-To: {$Tickets{‘TOP’}->Id()}
Content:
{
my $OUT;
my $ticket = $Tickets{‘TOP’};
my $agency=$ticket->FirstCustomFieldValue(‘Agency’);
$OUT = “Agency: $agency\n”;
$OUT;
} (/usr/lib/perl5/vendor_perl/5.10.0/RT/Action/CreateTickets.pm:653)
[Wed Nov 18 08:44:49 2009] [debug]: Workflow: yielding Subject: - Child
Queue: 20
Status: new
Parents: TOP
Type: ticket
Refers-To: 1830
Content:
Agency: 123123123 (/usr/lib/perl5/vendor_perl/5.10.0/RT/Action/CreateTickets.pm:669)
[Wed Nov 18 08:44:49 2009] [debug]: About to think about scrips for transaction #113500 (/usr/lib/perl5/vendor_perl/5.10.0/RT/Transaction_Overlay.pm:163)

Regards,
Tony

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

Hi,

I’m trying to find the login details of the users, ie the time user logged in and out of the RT.Is there any way other than checking the log files.Any help on this?

Thanks,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

Hi ,

Any updates on this?

Regards,
Tony-----Original Message-----
From: Tony John - ERS, HCL Tech
Sent: Tuesday, June 15, 2010 10:47 AM
To: rt-users@lists.bestpractical.com
Subject: User login logout details

Hi,

I’m trying to find the login details of the users, ie the time user logged in and out of the RT.Is there any way other than checking the log files.Any help on this?

Thanks,
Tony John

DISCLAIMER:

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

Hello Tony

Any updates on this?

Well, you can find login details in rt.log but only when loglevel is
debug I think. For logout thats a whole other problem. If someone just
decides to close its browser and then go home, you’ll never recieve a
logout from that.
Apart from that I don’t think the logout link will output debug info
into rt.log. That is something you’ll need to add.

Regards,

Joop

I think this would be a cool edition. Logout seems less important (and harder to track as mentioned), but having the last login time of a user would be very handy. I have been finding myself grepping the logs to see when a user has logged in. Not the best solution and not something average Joe-know-nothing-about-Linux would be able to do.From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Joop van de Wege
Sent: Wednesday, June 16, 2010 3:06 AM
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] User login logout details

Hello Tony

Any updates on this?

Well, you can find login details in rt.log but only when loglevel is
debug I think. For logout thats a whole other problem. If someone just
decides to close its browser and then go home, you’ll never recieve a
logout from that.
Apart from that I don’t think the logout link will output debug info
into rt.log. That is something you’ll need to add.

Regards,

Joop

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com