- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Ran into a situation recently with a customer where their monitoring solutions sent Launch in Context URL to the management console in the event payload and while they would see this data in the ServiceNow Alerts the links only showed up as text and not active hyperlinks.
Below is how we pulled the URL out of the event payload and made it actionable in the Alert.
Step 1: Parse URL link out of middle of Event Description field
To do this, we edited the appropriate Event Rule and in the "Transform and Compose Alert Output" section we clicked on the "Description" field that brings up "Edit Regex Expressions" dialog. This dialog allows us to setup regular expressions to parse data out of fields and assign them to existing or temporary fields either by highlighting a section for easy parsing or putting in a regex expression for more complex parsing. Since the URL string from this data source could be anywhere in the Description field we needed to define our own Regular Expression and put this in the "Write RegEx" field. Next in the "Expressions" field we typed in the temporary variable ("toolurl") that we wanted to assign the URL string to. Once done, we saved our updated Event Rule.
A little explanation for those not familiar with RegEx:
.* - Matches 0 or more characters, which would match on everything in the Description field up to http section
(https:\/\/\S+) - Everything between () will be what we want to capture and assign to our "toolurl" temporary variable.
This would be a string that starts with "https://" (NOTE: "/" are special characters and need to be
escaped with a "\". Lastly, the "\S+" will also include one or more Non-White space characters, which will
give us our entire URL string from the Description field, but stop capturing once we hit a white space in
the description field.
.* - Will match 0 or more characters after our URL string.
For more details on RegEx and to play around with parsing I recommend using RegEx 101.
Step 2: Create an Alert Action Rule to make URL Link Actionable
Now to make the URL in our "toolurl" variable actionable we created an "Alert Action Rule" to filter on only alerts where the Alert's "Additional Information" field contains our temporary variable "toolurl". In the "Launcher" tab we want to do the following:
- Enabled: Checked
- Display Name: Put in a readable name you want the URL to show as.
- URL: ${toolurl} - This is reference to our temporary variable we defined in the Event Rule. (NOTE: This field and assigned value will show up in the "Additional Info" field of the Alert.)
Step 3: Test Setup
We now only needed to test our setup either by waiting for an event to come in from our event source or by manually putting an event on the event queue. Once we got the event and associated Alert we could then go to the Alert and then click on "Quick Response" and see our Launcher link that will launch in context back to the event in our Management Console.
- 482 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.