Export due date of RT ticket to Outlook as a calendar appointment?

I would love it if RT had the ability to add/export an Outlook calendar appointment or reminder from inside a ticket. I’m thinking of something like a button in RT that says, “Create calendar reminder” and then prompts you to fill in the paramaters; type of calendar item (Outlook), dates, reminder, etc., and then that appointment would be added to your Outlook calendar; something almost exactly like the process for creating a new appointment in Outlook. Right now, I have to manually go to Outlook and create a calendar reminder for an RT ticket there, so it’d be very useful if RT could take the due date of a ticket and automatically create an Outlook calendar entry for that due date. Is there any integration out there like that already?

I realize RT already had due dates, but I have not spent any time on trying to configure those due dates to have reminders that pop up on the screen or send emails to you (is that even possible? To have RT send you an email reminder when a due date for a ticket is approaching?).

I’ve done something similar to this for our change ticketing system, that puts calendar entries into a shared Office365 “change calendar” using the Microsoft Graph API. However are you looking more for an iCal/ICS format file that you can download to a local client running Outlook?

Having RT set reminders for Due Dates is possible though, and we also use that for our change tickets. We have a custom scrip that runs to create reminder tickets when changes are finally approved, and another that wipes out the reminder when the change ticket is closed.

1 Like

Yes, that’s it. Thanks for that idea about a shared Office 365 calendar, too.

I like the sound of those scrips, too. They sound very useful. I was hoping there was already a feature in RT that would do what those scrips do, but I’m guessing there isn’t, since you had to make some custom scrips for it. Still, that is a good sign that one can custom code the feature! Thanks. Would you consider posting those scrips here, or is that not easily done?

I don’t know how helpful this is, but here you go: this is a cut down version of what we use (there’s some other local stuff in there which isn’t relevant that I’ve ripped out.

This is the custom action commit code from a scrip with a Condition of “On Status Change”, a user defined action and a blank template. The custom action preparation code is just return 1; as all the logic is in the commit block. Its in a custom change management lifecycle as well, so its looking for tickets where the state has just changed from “submitted” or “draft” to “open”, hence all the stuff looking back at the last transaction for the previous state.

You’ll obviously need to change it for your situation, but it may point you in the right direction.

my $ticket = $self->TicketObj;
if($ticket->Type eq 'reminder') {
    return 0; # Don't bother adding a reminder to a reminder
}
my $reminders = RT::Reminders->new($RT::SystemUser );
$reminders->Ticket($ticket->id);
my $dueobj = $ticket->DueObj;
if(!$dueobj->IsSet) {
    $RT::Logger->debug("No due date set on ticket #".$ticket->Id);
    return 0; # No due date set, so we can't set a reminder after it
}

if($ticket->Owner == $RT::Nobody->Id) {
    $RT::Logger->debug("No reminder when the owner is Nobody for ticket #".$ticket->Id);
    return 0; # No owner.
}

my $prevStatus = '';
my $transactions = $ticket->Transactions();
$transactions->Limit(FIELD => 'Type', VALUE => 'Status');
$transactions->OrderBy( FIELD => 'Created', ORDER => 'DESC' );
my $trans = $transactions->First;
if($trans->OldValue) {
    $prevStatus = $trans->OldValue;
}

if(($prevStatus eq 'submitted' || $prevStatus eq 'draft') && 
   $ticket->Status eq 'open') {

    my $subject = "Auto Reminder for ticket # " . $ticket->id . ": " . $ticket->Subject;
    my $owner = $ticket->Owner;
    my $due = $ticket->Due;
    my ($val, $msg) = $reminders->Add(Subject => $subject,
                    Owner   => $owner,
                    Due     => $due);
    return 1;
}
return 0;

As for the iCal/ICS stuff, you could always have a scrip that makes an iCal format file (there are Perl modules available to help do this) and then emails it to the ticket owner. Some mail clients can then interpret the iCal file and pass it into their own/another calendar app (I don’t know about Outlook, I don’t use it).

This is great, great stuff. Thanks a lot!

RT also has a built-in iCal feed you can use, which is based on results from a search. It doesn’t sound exactly like what you’re looking for, but you may be able to use the code. You can find more info here:

https://docs.bestpractical.com/rt/4.4.4/reporting/feeds.html#iCal

1 Like