Add to Email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 12:22 AM
Hi Team,
My requirement is:
add to email notifications:
Is this CIR associated with any migration factory or other enterprise tracking initiatives?
If answer is Yes to the following question(s), display: MF2
Is this in scope of MF2 initiative? = Yes.
How can I achieve these, please help to achieve this requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 02:14 PM - edited 02-06-2025 02:15 PM
@JVINAY , Glide Record to the table where "mf2_initiative" field exists.
also, here's the updated code :
var mf2initiative = [];
var grSD = new GlideRecord('table_name'); // Replace with actual table name
grSD.addQuery('sys_id', 'IN', current.mf2_initiative.toString());
grSD.query();
while (grSD.next()) {
mf2initiative.push(grSD.getValue('mf2'));
}
if (mf2initiative.length == 0) {
template.print('None');
} else {
template.print(mf2initiative.join(',')); // Display MF2 values
}
Try and let me know if this works
Please mark reply as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2025 05:23 AM
Thanks for your response.
I want to fetch ths variable form the Variables ( Record producer)
I have developed the code metioned below . Please correct me any change required.
//Fetches the Mf2 value from variables
var mf2initiative = current.variables.mf2initiative.getDisplayValue();
if (mf2initiative.length === 0) {
template.print('None');
} else {
template.print(mf2initiative.join(','));
}
})(current, template, email, email_action, event);
Thank you for your cooperation.