Ensign
Ensign
69 views

EPI groovy script - assign event to user using setAssignedUserId method

Jump to solution

Hello,

I have EPI groovy script what is enriching and modify incoming events.
Code is located under Administration -> Event Processing Customizations -> AFTER CI/ETI RESOLUTION
All is working well except that I do not know how to write code to assign match event to existing user.

In documentation for Event interface there is method called: setAssignedUserId

void setAssignedUserId(UUID assignedUserId)
Sets the user id to which this event is assigned to

How to write code what will assign event to user ‘John’?

Pseudocode may look like:

def process(List<Event> events)
{
events.each {
event ->
event.addAnnotation("Event assigned to user John", "John")
// assign event to user 'John'
// event.setAssignedUserId(XXXX)
}
}

Thanks,
Dusan

1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert
You will need to map the user name to user ID.
You can query users and their IDs via CLI or REST API. You can keep this in cache map which you should initialize in your "init" method.
Check this code snippet for example how to init cache map and refresh it every X seconds: https://docs.microfocus.com/itom/Operations_Bridge_Manager:2020.10/EPIScriptEnrichment

View solution in original post

2 Replies
Micro Focus Expert
Micro Focus Expert
You will need to map the user name to user ID.
You can query users and their IDs via CLI or REST API. You can keep this in cache map which you should initialize in your "init" method.
Check this code snippet for example how to init cache map and refresh it every X seconds: https://docs.microfocus.com/itom/Operations_Bridge_Manager:2020.10/EPIScriptEnrichment

View solution in original post

Ensign
Ensign

Hi Asaf,

Thank you. I will look on that code example and implement something similar for user assignment.

Dusan

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.