Cadet 3rd Class Cadet 3rd Class
Cadet 3rd Class
382 views

Retriving Hostname(related CI) in title category.

Hello ,

Is there anyway to pick related ci in my title category using groovy script.

Labels (1)
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Do you mean to ask if it's possible to modify title/category event attributes with some attribute of a related CI (to which the event was resolved) in the EPI groovy script?

If so, the answer is positive. You will have to work with RTSM API in your groovy script to get access to the related CI attributes. Apparently your groovy script must be running in a EPI step AFTER CI resolution.

0 Likes
Cadet 3rd Class Cadet 3rd Class
Cadet 3rd Class

Thank you for the help Dmitry Shevchenko. If possible Could you provide me the script. This is my existing script. 

import java.util.List;
import com.hp.opr.api.scripting.Event;

class GroovyScriptSkeleton
{
def init()
{
}

def destroy()
{
}

def process(List<Event> events)
{
// Reuse following skeleton for processing events
try
{
// Example: Title of all events are prefixed with "Modified by CA/EPI: "
//
// events.each {
// event -> event.setTitle("Modified by CA/EPI: " + event.getTitle())
//
// always include following check for each event
// if(Thread.interrupted())
// throw new InterruptedException()
// }
}
catch(InterruptedException e)
{
return
}
}
}

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.