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? 

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

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

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