Clarity Service Management

Expand all | Collapse all

How to trigger a reminder email x hrs before scheduled start date

Giedrius Bekintis07-11-2016 06:26 PM

  • 1.  How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 02:25 PM

    I was asked by my change management team if it was possible to trigger a reminder email 12 hours before the scheduled start date of a change.  I don't see a way that I can configure that.

     

    The requirements would be as follows:

    • It wouldn't be for all change categories, only select ones.  I can identify them with a common flag I added to the chgcat table.
    • It would need to go out 12 hours before the scheduled start date on the ticket
    • If the scheduled start date changed after the email event/animation was loaded, it should update to coincide with the new date so as not to send out false reminders either early or late.
    • It may or may not be restricted to tickets in an Approved status.  That is up in the air at the moment and still being discussed.

     

    I know there are ways to trigger events on a delayed timer but that's in a specific # of hours/minutes/sec from the point when the event loads and isn't based on another field, such as the scheduled start date.

     

    Does anyone know of a way to accomplish this goal natively within Service Desk or do I need to construct something in PAM?



  • 2.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 04:20 PM

    I would suggest a PAM process that you schedule to run every hour. One operation would be to run a query against the mdb to select out the Change Order that meet the criteria. If any of the selected Change Orders has a scheduled start date between 12 and 11 hours from now then send out a notification.



  • 3.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 04:38 PM

    Yeah, that's always an option if I have to.  I was hoping that there was a way in Service Desk to do it without going to outside processes.



  • 4.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 04:49 PM

    As far as I can tell, the notifications in SDM are reliant on a specified date/time dictated by the SLO.  One thought may be when a CO case is created, the scheduled start date would be set to a specific timeframe that is always X number of days from when the case was created, and in doing so, have an SLA attached with a notify designed to fire X-1 days from when the case was created.  This is a more roundabout method of doing what you are asking.  However, I don't think there's a way to directly tie the scheduled start date to a notification to be sent a number of hours/days from the start date.  Not without custom spel coding.



  • 5.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 04:56 PM

    Dave,

       I can't stipulate that the scheduled start date is always based on the open date.  These are CAB changes in particular that we're speaking of and those can be scheduled days, weeks or months from the open date depending what the change is for and how important it is.  While I'm not surprised by your answer about custom spel, I am disappointed that this kind of event scheduling/animation doesn't exist natively.  =(



  • 6.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 05:00 PM

    The only way I can think of is to create the trigger on start date change that will run the spel code. Spel code shall calculate fire time for the event and attach an event. If start date is changed the same script should cancel any existing event of this type and attach new one. So it is an easy task if you don't afraid of doing spel customizations, since there is a lot of legends around them.



  • 7.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 05:11 PM

    I know how to add the trigger you speak of.  And I do have some spel samples I could refer to for adding the event.  Not sure if any of them set the time that it should fire though so I don't know how I'd write that code.  I think all the ones I have I've set the delay in the event definition template if at all.  But I've never written/borrowed any that searched out and cancel any events that should no longer be applicable.



  • 8.  Re: How to trigger a reminder email x hrs before scheduled start date



  • 9.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 05:46 PM

    Well well well.  Thanks.  I've given the spel a quick read and I have a couple questions.  At least until I can more thoroughly absorb and test some of this...

     

    Since the trigger in the sample is firing on change of the call_back_date field and you're passing that into the function in the trigger, am I to assume that [2] is always old value and [3] is always new value of the field in question?

     

    Also, since my need is 12 hours before hand, and I'm assuming dur is in seconds, i would need to add - 43200 to the duration calculation to get the actual fire time, right?   If so, what happens if that new calculation winds up being in the past, like if someone sets the scheduled start date to 4 hours from now?  Will the event fail or will it fire immediately?

     

     



  • 10.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 06:20 PM

    Q1 assume that [2] is always old value and [3] is always new value of the field in question?

    A1 Yes

    Q2 Also, since my need is 12 hours before hand, and I'm assuming dur is in seconds, i would need to add - 43200 to the duration calculation to get the actual fire time, right?

    A2 No you will need to subtract, if you need to have 12 hours taking in to account workshift you may try to use workshift_work2abs("Mon - Fri { 8:00 am - 5:00 pm }", date, duration); not sure if this function will work with negative duration but you may give it a try (https://communities.ca.com/message/241888844#comment-241888844 )

    Q3 If so, what happens if that new calculation winds up being in the past, like if someone sets the scheduled start date to 4 hours from now?  Will the event fail or will it fire immediately?

    A3 it will be canceled the same way you have possibility to cancel event in service types tab of the ticket



  • 11.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 06:30 PM

    Ok cool.  As for Q2, I should have put quotes around the extra.  I meant I need to add " - 43200"  to the formula meaning subtract that much from the amount I already calculated.

     

    Workshift wasn't raised as a concern so until they say it is, I would probably not bother, especially since CAB Changes can happen at any time/day of the year (outside of blackout dates) but something to look into if it comes up.  Thanks.  I will experiment with this.  Much appreciated.



  • 12.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-13-2016 05:10 PM

    Hi Brett_Zipkin - We're you able to get it working? Thanks!



  • 13.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-13-2016 06:24 PM

    I haven't had a free moment since I skimmed it.  Got roped into 5 other priorities.  I'm hoping to sit down and give it some time this week if I can though since I need to make some adjustments.



  • 14.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 06:26 PM

    Ops sorry Q3 I think it will be fired immediately.



  • 15.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 06:27 PM

    Any way such situation you can handle in your spel code



  • 16.  Re: How to trigger a reminder email x hrs before scheduled start date

    Posted 07-11-2016 06:41 PM

    I also would suggest to use following methods to attach the events SPEL EVENT methods

    I can't find time to update my blogpost to use CA preferred methods, but I will do this in near future.