One of our customers wanted to change the behaviour when right-clicking on an event. Instead of opening it inside the DASH, open a new browser tab. In this blog post we will show you, how to do just that.
The Starting Point
The IBM Runbook Automation (RBA) integration into the OMNIbus Event Console allows you to enrich incoming events. For this a “Trigger” is created within the Cloud Event Management (CEM) UI. After the trigger matches an incoming event, this event will have a additional information. The information tells the operator, which runbook to execute in order to resolve this event. So far so good!
You can use this now in the following way: The user right-clicks the event, selects “Launch Runbook”. This opens the runbook within the DASH console. Our customer wanted this to change: The runbook should open in a new browser tab.
The Solution
Luckily, you can change this quite easily. Usually, you would follow the Launch-in-Context documentation. However in this case, in step 7 instead enter the code below:
var runbookId = '{$selected_rows.RunbookID}';
var runbookParams = '{$selected_rows. RunbookParametersB64}';
var rbaUrl = "https://${enterYourRbaUrlHere}:3005/index?subscriptionId=ld#/template/ExecuteRunbook?rbid=";
if (runbookId == '' || runbookId == ' ' || runbookId == ',' || runbookId == '0' || runbookId == 0) {
alert("This event does not have a runbook attached!");
}
else {
var rbaUrl = rbaUrl + runbookId;
if (runbookParams == '' || runbookParams == ' ' || runbookParams == ',' || runbookParams == '0' || runbookParams == 0) {
alert("This event did not set any runbook parameters!");
}
else {
runbookParams = encodeURIComponent(runbookParams);
var rbaUrl = rbaUrl + "&bulk_params=" + runbookParams;
}
var win = window.open(rbaUrl, '_blank');
if(win == null) {
alert("Please allow pop-ups on this site.");
}
else {
win.focus();
}
}
Special thanks to Dominic Lehr from openAdvice who came up first with this solution.
#how-to#runbook#Automation#RBA#cem#omnibus