Tuesday, September 09, 2008

ITSM Surveys

One of my recent challenges was to setup Survey Notifications in Frontrange ITSM. It was a slow uphill battle but succeeded and will post my solution.

This text assumes that you are familiar with ITSM, Business Rules, Triggers, Quick Actions and Expressions.

Hope it helps!

THE GOAL: On incident close, send a survey notification that will contain a link to an external web site. The notification should be sent every 5th incident closure and only to user's with emails that end in worldvision.org or wvi.org. If the email is blank or the user closing the incident is not a member of the Helpdesk team, no survey should be sent.

continued...

SURVEY SETUP
1) Create a quick action that will generate a notification email as required.
2) Create an expression script that will be used to constrain as required above when these email notifications are sent.

import System
import Fusion

import Fusion.Api
class FusionScriptWrapper implements IScriptWrapper {
function FusionScriptWrapper()
{
// place constructor logic here
}
function Process(currentBusinessObject :
Fusion.Api.BusinessObject, currentField : Fusion.Api.Field) : Object
{
var objReturn : Object
objReturn = false;
//the following script will return a value of true if
//text in email field is greater than 1 AND
//text in email field ends with @worldvision.org AND
//incident ownerteam field = ISG Support AND
// Incidentnumber ends with 5 OR
// Incidentnumber ends with 1

if
(currentBusinessObject.GetField("Email").NativeValue.ToString().length > '1' &&
(currentBusinessObject.GetField("OwnerTeam").NativeValue == 'ISG Support' &&
(currentBusinessObject.GetField("Email").NativeValue.ToString().toLowerCase().Trim().EndsWith('@worldvision.org') ||
currentBusinessObject.GetField("Email").NativeValue.ToString().toLowerCase().Trim().EndsWith('@wvi.org')) &&
(currentBusinessObject.GetField('IncidentNumber').NativeValue.ToString().Trim().EndsWith('5') ||
currentBusinessObject.GetField('IncidentNumber').NativeValue.ToString().Trim().EndsWith('0'))))
{
objReturn = true;
}
return objReturn
}
}

3) Create a trigger that will watch for incident status changed to closed and use the expression that was created above.

4) Finally create a Business Rule that combines the trigger and the QA.

5) Test, test, test...


Extra credit...
~ADD SURVEY LAST SENT FIELD TO EMPLOYEE PROFILE TO LIMIT HOW OFTEN SURVEYS ARE SENT TO A SINGLE USER

create 3 fields in profile employee
1)SurveyLastSent Date / Time field, display date only
2)SurveyMinSince (filed will be calculated with date calculation)
3)SurveyDaysSince (field will be calculated with jscript expression)
import System
import Fusion
import Fusion.Api
class FusionScriptWrapper implements IScriptWrapper
{
function FusionScriptWrapper()
{
// place constructor logic here
}
function Process(curBizObj : Fusion.Api.BusinessObject, currentField : Fusion.Api.Field) : Object
{
var objReturn : Object
var surveyminsince;
var surveydayssince;
surveyminsince = curBizObj.GetField("SurveyMinSince").NativeValue;
surveydayssince = (surveyminsince / 1440);
objReturn = surveydayssince;
return objReturn;
}
}
4) Modify QA to update profile employee SurveyLastSent date field with current date time
5) Update SendISGSurveyjscript to return true only if SurveyDaySince>30
import System
import Fusion
import Fusion.Api
class FusionScriptWrapper implements IScriptWrapper {
function FusionScriptWrapper()
{
// place constructor logic here
}
function Process(currentBusinessObject :
Fusion.Api.BusinessObject, currentField : Fusion.Api.Field) : Object
{
var objReturn : Object
objReturn = false;
if
(currentBusinessObject.GetField("Email").NativeValue.ToString().length > '1' &&
(currentBusinessObject.GetField("SurveyDaysSince").NativeValue.ToString().value > '1' &&
(currentBusinessObject.GetField("Email").NativeValue.ToString().toLowerCase().Trim().EndsWith('@worldvision.org') &&
(currentBusinessObject.GetField("OwnerTeam").NativeValue == 'ISG Support' &&
(currentBusinessObject.GetField('IncidentNumber').NativeValue.ToString().Trim().EndsWith('5') ||
currentBusinessObject.GetField('IncidentNumber').NativeValue.ToString().Trim().EndsWith('0'))))))
{
objReturn = true;
}
return objReturn
}
}
6) Add field to incident table 'SurveyDaysSince'
set to auto-fill
7) Test it. ;-)

0 Comments:

Get the latest 'geek' post via RSS...

Subscribe below for email updates...

Enter your email address:

Delivered by FeedBurner

/* Extra Links ----------------------------------------------- */
tangential
tangential