Am 27.10.2015 um 16:57 schrieb Asif Iqbal: > anyone added a logic to not auto assign the ticket if it is created > during holiday or weekends? > > We are using Lifecycles to implement Due date based on business hours > using the SLA extension. But not sure how auto assign can take advantage > of that.
If you have rt-extension-sla installed, then you can create a Business::Hours [1] object in a RT scrip with: my $bh = RT::Extension::SLA->BusinessHours; If you don't have holidays in your sla config (RT::ServiceBusinessHours), then you can feed the $bh from above within you scrip. We use Date::Holidays::DE [2] for this, which have the german holidays, ans is also available for other countries. Then you can check if you are within business hours with: if ($bh->first_after(time()) == time()) { # within business hours } else { # not within business hours } Chris [1] https://metacpan.org/pod/Business::Hours [2] https://metacpan.org/pod/Date::Holidays::DE