Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2024 07:18 AM
Hi Devanshi,
probably easiest to create a BR that adds the questionnaire to the INA on creation of the DD (or whenever the trigger suits your needs best). The example below does the trick.
// create new INA
var grIRQ = new GlideRecord("sn_vdr_risk_asmt_internal_assessment");
grIRQ.initialize();
grIRQ.dd_request = current.sys_id;
grIRQ.name = "IRQ";
grIRQ.short_description = "IRQ";
grIRQ.tiering_assessment_assessors = current.vendor.vendor_manager.toString();
grIRQ.assigned_to = current.vendor.vendor_manager.toString();
grIRQ.vendor = current.vendor;
irqId = grIRQ.insert();
// identify your questionnaire template sys_id
var grQuest = new GlideRecord("asmt_metric_type");
grQuest.query("name", "Default IRQ");
if(grQuest.next()) {
var questId = grQuest.sys_id;
}
// insert m2m to add questionnaire to INA
var grQuestToINA = new GlideRecord("sn_vdr_risk_asmt_m2m_tiering_asmt_questionnaire");
grQuestToINA.initialize();
grQuestToINA.metric_type = questId;
grQuestToINA.vdr_tiering_assessment = irqId;
grQuestToINA.insert();