Clarity Service Management

RE: Text API method 

27 days ago
Statistics
0 Favorited
13 Views
1 Files
0 Shares
5 Downloads
Attachment(s)
txt file
Lookup_method_example.txt   1K   1 version
Uploaded - 08-19-2019

Tags and Keywords

Comments

27 days ago

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

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.