I have to create inbound action.

niveditakumari
Mega Sage

Hi, 

 

I have to create Inbound Action. 

1) Create an inbound action to accommodate email coming from portal@remota.com to servicenow's mailbox
2) This RITM catalog item name would be Device Unlock Request, short description of the RITM upon creation would be -> Device Unlock Request - <RITM_Creation_Date>
3) REQ short description and description = Device Unlock Request
4) RITM would be assigned to Support Engineering - Tier 1 group
5) Email body would be pasted into RITM description 
[Note: Mostly email body would contain a table which would host two columns, Device Serial and Offboarding date. Table would contain multiple rows i.e. multiple device information altogether in a single email, we aren't creating ticket per device at the moment rather clubbing into RITM as an initial process]
4) Priority would be set as P3 

 

Can you please help me to create Inbound Action to achieve that. 

 

Regards, 

Nivedita 

 

 

2 REPLIES 2

Matthew_13
Mega Sage

Hi Buddy,

 Here’s the simplest and most accurate way to do it that i can come up with.

Create an Inbound Email Action (Type = New) with this condition:

email.from && email.from.toLowerCase() == 'portal@remota.com'

Use this script replace the two sys_ids:

(function runAction(email, action, event) {

    var CAT_ITEM_SYSID = 'DEVICE_UNLOCK_CATITEM_SYSID';
    var TIER1_GROUP_SYSID = 'SUPPORT_ENGINEERING_TIER1_SYSID';

    // Create REQ
    var req = new GlideRecord('sc_request');
    req.initialize();
    req.short_description = 'Device Unlock Request';
    req.description = 'Device Unlock Request';
    var reqId = req.insert();

    // Create RITM
    var ritm = new GlideRecord('sc_req_item');
    ritm.initialize();
    ritm.request = reqId;
    ritm.cat_item = CAT_ITEM_SYSID;
    ritm.short_description = 'Device Unlock Request - ' + gs.nowDate();
    ritm.description = email.body_text || GlideStringUtil.stripHTML(email.body_html);
    ritm.assignment_group = TIER1_GROUP_SYSID;
    ritm.priority = 3; // P3
    ritm.insert();

    action.setAbortAction(true);

})(email, action, event);

This will:

  • Create one REQ + one RITM per email

  • Set the correct short descriptions

  • Copy the full email body (including tables as text) into the RITM

  • Assign to Support Engineering – Tier 1

  • Set Priority = P3

If you later want to parse the device table into structured data, that can be added on top of this.

 

@niveditakumari - Please mark Accepted Solution and Thumbs Up if you find Helpful 🙂

yashkamde
Tera Expert

Hello @niveditakumari ,

You can create a flow for that,

select the trigger condition as inbound email and type as SMTP -> then create a request for linking the ritm into that
Screenshot 2026-01-17 152700.png

then create a ritm in which add req -> select data pill upper created REQ
Screenshot 2026-01-17 152717.pngThis is the automated inbound action..
If my response helped mark as helpgul and accept as solution.