
Jason Hemmelgarn
Hello,
I'm trying to see if there is a way in the action scripts I can edit the timeout based on the severity of the ticket?
We do not want high tickets to escalate, but we do want them to notify.
In other words, if it's a HIGH ticket , I want a 5 min timeout.
If it's a Critical ticket, I want a 4 hour timeout.
I've tried editing the initial script, and adding the following to OptionalConfiguration:
IF ( event.severity == "1 - critical" ) #note lower case
$main.timeout = 86400
ENDIF
IF ( event.severity == "2 - high" )
$main.timeout = 500
ENDIF
This causes the event to error, and not notify.
Does anybody have any thoughts?
0
Comments
Please sign in to leave a comment.
Hey Jason. I'm pretty sure that timeout is in seconds, so 86400 = 24 * 60 minutes/hour * 60 seconds/minute. Maybe try 14400 = 4 * 60 * 60. Although, 500 seconds is a little over 8 minutes, so it seems like that shouldn't error.
What is the error you are getting?
Thanks for the reply Travis. You are right, it is in seconds. The time out in seconds should be 300.
To give a little more back ground, I can change the $main.timeout to whatever I want, that works fine. It's when I add the event.severity check that it errors. Looking in logs, I don't see the reason for the error. Unfortunately I don't have access to the ITSM server, only the xMatters server.
Here's a snippit towards the end of the log, I have more information if need be:
companyId=1, companyName='FirstEnergy', lastActionUser='null', subscriptions=[], sourceNotifications=[com.invoqsystems.apex.model.notifications.source.SourceNotificationImpl@1e943597[presentationScript=com.invoqsystems.apex.model.scripts.invoqscript.ScriptImpl@22f25074,deviceTypePresentationScript={},responseScript=com.invoqsystems.apex.model.scripts.invoqscript.ScriptImpl@5191dd74,state=CREATED,recipients=<null>,timeframeOverride=false,ignoreDeviceDelays=false,emergencyDeviceUsage=false,deviceFilters=[],escalationOverride=<null>,allowDuplicateOverride=false,allowDuplicate=false,lastUpdateRecipientId=<null>,lastUpdateDate=<null>,targetedRecipients=[MSG_&_COLLABORATION],relatedSubscription=<null>,active=true,handleDeliveryEvents=true,currentOrder=0,priority=MEDIUM,pollInterval=0,pollPeriod=0,notificationEndDate=Fri Mar 27 15:40:21 EDT 2015,scriptObjectKey=b6babc4f-5848-4d2b-823d-31fedd234bf0,emergencyDeviceUsageOverride=false,allowOutOfCoverageNotifications=false,deviceFilteredOutByScript=false,validatedDeviceNames=[],creationDate=Fri Mar 20 15:40:21 EDT 2015,id=1311052,internalUUID=4aa791f6-876c-45c0-b91e-823535bff8b4,category=SOURCE,deliveryStatus=NOTIFYING,version=0,failureType=<null>,companyName=FirstEnergy,deliveryStatusChangedDate=Fri Mar 20 15:40:21 EDT 2015,type=<null>]], node=com.invoqsystems.apex.model.location.ApplicationServerNodeImpl@5d4c6fdf, recipientContexts={}, voiceMessage=null})
2015-03-20 15:40:21.593 EDT [pb-process-10] INFO FirstEnergy EV[1587004] - - PROCESS_TERMINATED_WITH_ERROR-MAIN Event ID:1587004 MAIN
2015-03-20 15:40:21.608 EDT [NotificationResolutionEngineInternalEventTimer] DEBUG - - Beginning to process pending notification events with batch size 50.
2015-03-20 15:40:21.611 EDT [NotificationResolutionEngineInternalEventTimer] DEBUG - - Completed processing a total of 0 pending notification events in 3 ms.
2015-03-20 15:40:21.612 EDT [pb-process-10] INFO FirstEnergy EV[1587004] - - EVENT_TERMINATED_WITH_ERR-null Event ID:1587004
2015-03-20 15:40:21.612 EDT [pb-process-10] DEBUG FirstEnergy EV[1587004] - - Delete objects for process:
2015-03-20 15:40:21.616 EDT [pb-process-10] DEBUG FirstEnergy EV[1587004] - - Delete object [b6babc4f-5848-4d2b-823d-31fedd234bf0][Object key{b6babc4f-5848-4d2b-823d-31fedd234bf0} Name{alert}] is done
2015-03-20 15:40:21.616 EDT [pb-process-10] DEBUG FirstEnergy EV[1587004] - - Delete objects for process [b6babc4f-5848-4d2b-823d-31fedd234bf0] is done
2015-03-20 15:40:21.616 EDT [pb-process-10] WARN FirstEnergy EV[1587004] - - Event 1,587,004 failed to process interpreter event com.invoqsystems.foundation.interpreter.invoqscript.processor.StateEvent@7ae92108. try 0 times.
2015-03-20 15:40:21.636 EDT [pb-process-10] INFO FirstEnergy EV[1587004] - - EVENT_CREATED-null Event ID:1587004
2015-03-20 15:40:21.654 EDT [pb-process-10] DEBUG FirstEnergy - - Complete Processing Message MBM_ID:1362007 Time to Process: 644 ms
2015-03-20 15:40:21.658 EDT [nre-process-2] DEBUG FirstEnergy - - Begin Processing Message MBM_ID:1363099 Message: GenerateNotificationsMessage Role: CONSUMER
2015-03-20 15:40:21.659 EDT [nre-process-2] INFO FirstEnergy - - Processing EVENT: com.invoqsystems.apex.component.communication.messages.GenerateNotificationsMessage@d4df662a
Any thoughts would be helpful.
I want to mark this as solved. After much trial and error, I was able to get this work.
It wouldn't work, because we hadn't called the tokens yet. To resolve, I copied the code from the subroutines that call the tokens in to the optional configuration. That allows it to then pick the correct timeout.
@eventTokens = new ScriptObjectLinkedHashMap()
@eventTokens::put("event.severity", event.severity)
$sev = $event.severity
$sev::toLowerCase()
IF ( $sev == "1 - critical" ) #note lower case
$main.timeout = 86400
ENDIF
IF ( $sev == "2 - high" )
$main.timeout = 300
ENDIF
Hey Jason! FYI I don't think you need those first two lines. If "severity" comes in as a property then $event.severity should be accessible to you. I don't think you're actually using @eventTokens for anything in particular.
Right, as stated above, I had to call the token first. After that - we were good as gold.