Clarity Service Management

RE: Text API method 

08-19-2019 03:08 PM
Statistics
0 Favorited
18 Views
1 Files
0 Shares
6 Downloads
Attachment(s)
txt file
Lookup_method_example.txt   1K   1 version
Uploaded - 08-19-2019

Tags and Keywords

Comments

20 days ago

This is very helpful.

08-20-2019 08:52 AM

Your line

int lookup_asset_by_alarm_id(string symbol, string obj_type, object obj, string attribute) {

should be

uuid lookup_asset_by_alarm_id(string symbol, string obj_type, object obj, string attribute) {

08-20-2019 08:03 AM

I did the spel like this:
#define SYNTAX STRICT

int lookup_asset_by_alarm_id(string symbol, string obj_type, object obj, string attribute) {

string method;
method = "lookup_asset_by_alarm_id";
uuid matchingID;
logf(MILESTONE, "%s: Entering method: %s", method, symbol);
logf(VERBOSE, "%s: obj_type=%s", method, obj_type);
logf(VERBOSE, "%s: attribute=%s", method, attribute);
logf(VERBOSE, "%s: obj.id=%s", method, obj.id);

matchingID = (uuid)expand(format("&{'%s' = nr.alarm_id->id}", symbol));
if (is_null(matchingID)) logf(MILESTONE, "%s: %s not found", method, symbol);
else logf(MILESTONE, "%s: %s found", method, symbol);
logf(SIGNIFICANT, "z_reporting_location: %s", matchingID);
return matchingID;
}
The matchingID field is returning configuration item ID, but the incident is not being populated with configuration item from maileater.
In text__api I have this new line:

INCIDENT.AFFECTED_RC_IP=affected_resource.UUID.lookup_asset_by_alarm_id

Related Entries and Links

No Related Resource entered.