Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

@Mention email notification issue

krishnanara
Tera Contributor

In the OOB notification 'Activity Stream @Mention Email', I'm facing an issue with the email script ng_activity_mention_body. For some emails, the script executes correctly, providing the ticket number in the subject and link in the body. However, for other emails, the script doesn't execute, resulting in missing links and ticket details. Is there a fix for this inconsistency?

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@krishnanara 

in which cases it's failing?

are you able to identify any pattern for the failure?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I can't able to figure out that but I see the email script as below

krishnanara_0-1762345494815.png

krishnanara_1-1762345567893.png

krishnanara_2-1762345621613.png

 

 

@krishnanara 

you need to identify the pattern and since this is OOTB better to raise a case with ServiceNow if you find some bug.

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

want to understand the below email script how this is working

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {
    //gs.info("current table is: " + current.table);
    //gs.info("current document is: " + current.document);
    var result = new ActivityMentionEmailValues().getEmailValues(current.table, current.document);
    //gs.info("Notification result is: " + result);
    if (result) {
        result = JSON.parse(result);
        email.setSubject(gs.getMessage("You have been mentioned in {0}", result.subjectText));
        template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>");
        template.print(gs.getMessage("You have been mentioned by {0} in", current.user_from.name));
        template.print("&nbsp;<a href='/nav_to.do?uri=" + result.className + ".do?sys_id=" + result.recordSysId + "'>" + result.linkText + "</a></p>");
    }

})(current, template, email, email_action, event);