I have created inbound action and it should create req and ritm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi,
I have created inbound action and it should create req and ritm and it should email target in email log record.
I have written code and it is creating req and ritm and it is not adding ritm to email target.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
try this
(function runAction(current, email, event) {
// Create REQ
var req = new GlideRecord("sc_request");
req.initialize();
req.short_description = "Device Unlock Request";
req.description = "Created from inbound email";
var reqSysId = req.insert();
// Create RITM
var ritm = new GlideRecord("sc_req_item");
ritm.initialize();
ritm.request = reqSysId;
ritm.cat_item = gs.getProperty("rh_device_unlock_request");
ritm.short_description = "Device Unlock Request - " + new GlideDate().getDisplayValue();
ritm.description = email.body_text;
ritm.priority = 3;
ritm.assignment_group = gs.getProperty(
"rh_tier_1_support_engineering",
"Tier 1 - Support Engineering"
);
ritm.insert();
sys_email.target_table = "sc_req_item";
sys_email.instance = ritm.sys_id;
sys_email.update();
})(current, email, event);
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Would you mind closing your earlier questions by marking appropriate response as correct?
Members have invested their time and efforts in helping you.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hello @niveditakumari ,
In email record, the Target field you want to add as ritm has reference to User(sys_user) table :
Can you plz describe/clarify your requirement??
