- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-24-2024 10:39 PM
I'm trying to pull through the details of a Affected Ci (task_ci table) fields as Technology manager, Name and put them in an Notification email template (change_request table), and I'm not sure what the syntax would be to do this, I've tried various variations on ${table name.field name} but nothing seems to be working.
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-30-2024 01:29 AM
Hi @sureshpcse
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-26-2024 02:44 AM
hi @sureshpcse ,
you can try below code in email scrip as your notification was created on the Change table
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
// var recComments = current.comments.getJournalEntry(3);
// var formattedComments = recComments.replace(/\n/g, "<br>");
// template.print(formattedComments);
var table = current.sys_class_name;
var taskci = new GlideRecord("task_ci");
taskci.addQuery("task", current.sys_id);
taskci.query();
while (taskci.next()) {
var gr1 = new GlideRecord("cmdb_ci")
gr1.addQuery("sys_id", taskci.ci_item);
gr1.query();
if (gr1.next()) {
template.print("OWNED BY IS : " + gr1.getDisplayValue('owned_by')); // change to your field here because in my PDI i do not have technology manager field
}
}
})(current, template, email, email_action, event);
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-30-2024 12:25 AM
Thank you very much for the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-30-2024 12:26 AM
Thank you very much
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-30-2024 01:29 AM
Hi @sureshpcse
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."