Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
563 views

Question about Related Records variable in Incidents

Good afternoon Experts,

I'm trying to create an HTML notification for Incidents and I have ran into an issue trying to find the variable for the Related Records?

I have $RECORD.relatedid but there is nothing showing up.

Can someone help with this?4-12-2017 1-29-01 PM.png 

0 Likes
3 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Question about Related Records variable in Incidents

Related record information is stored in another table called "screlation". Each relation has 2 records, one for each side of the relationship.

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Question about Related Records variable in Incidents

you can check whether this field contains a value going into the some incident, and type in command line:

relatedid in $L.file

if this value is displayed through virtualJoin and is not stored in a dedicated variable in the current table, then nothing will be displayed.

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Question about Related Records variable in Incidents

Yeah, there's not going to be an OOB variable for this, and there's a couple of reasons - 

One, any record can be related to MULTIPLE other records.  You can have an Interaction that is related to several Requests or Changes as Service Requests, or to multiple Incidents (if multiple teams need to get involved to resolve.)  An Incident ticket may be related to several different Interaction records, Change records or Problem records... So there's not a way to have -one- variable represent all possible versions of what you might mean when you say 'related' record.

So, you'll have to come up with something yourself.

For example, let's say in your use case, you're sending an HTML based email to a customer after they have an Interaction open and escalated to an Incident ticket (or opened and escalated to an existing Incident ticket) and you want to populate the data from the related Incident.

In the Expressions tab of the HTML Template record, you'll need something like (and this is only an example.  You may need to tweak this for your specific envrionment):

var scRel = new SCFile("screlationship");
var getScRel = scRel.doSelect("source=\""+$RECORD.incident_id+"\" and depend.filename#\"problem\"");
if (getScRel == RC_SUCCESS){
    var RELATED = new SCFile("probsummary");
    var getRelated = RELATED.doSelect("number=\""+scRel.depend+"\"");
}

Then, in your email, you can use {RELATED.____} to reference any field within the related Incident ticket.  For example, you could use {RELATED.number} for the IM number or {RELATED.assignment} for the assignment group assigned to that Incident, or whatever.

If all you're looking for is the IM number, you wouldn't need the if... section, and you could just use {scRel.depend} as th related IM number.

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.