CA Service Management

RE: Text API method 

Aug 19, 2019 03:08 PM
Statistics
0 Favorited
51 Views
1 Files
0 Shares
16 Downloads
Attachment(s)
txt file
Lookup_method_example.txt   1 KB   1 version
Uploaded - Aug 19, 2019

Tags and Keywords

Comments

Oct 24, 2019 01:01 PM

This is very helpful.

Aug 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) {

Aug 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.