Need help in inbound email action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Team
can any one please help me on this below requirement
For ' Request Help ' catalog item
- If a request is coming from an email :
--- User from Email address that is being sent from .
- if a user is not identified user requested for
- if a user is still not identified set Opend by field ' Person not in database '
How to configure this required .
can any one please help me steps
Note - Email subject should contains ' EpicCare Link '
Request should created along with ritm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @nameisnani
Try this:
//Replace Sys_id as required.
Inbound Email Action Script
- Navigate to System Policy > Email > Inbound Actions and
- create a new record for the sc_req_item table.
var senderEmail = email.from;
var userGr = new GlideRecord('sys_user');
userGr.addQuery('email', senderEmail);
userGr.query();
var cartId = GlideGuid.generate(null);
var cart = new Cart(cartId);
var item = cart.addItem('SYS_ID_OF_REQUEST_HELP_CATALOG_ITEM'); // Replace with your Catalog Item's sys_id
if (userGr.next()) {
cart.setVariable(item, 'requested_for', userGr.sys_id);
cart.setVariable(item, 'opened_by', userGr.sys_id);
} else {
cart.setVariable(item, 'opened_by', 'SYS_ID_OF_PERSON_NOT_IN_DATABASE_RECORD');
}
var rc = cart.placeOrder();
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday