Check if INC hs been created in Employee Center or directly in SN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 05:22 AM
Hi All
I have a requirement to check if INC has been created in Employee Center or directly in SN.
If in Employee Center portal then I need to set contact_type to Self Service
If directly in SN then I need to set contact_type to Telefon
How can I achieve this?
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 05:31 AM
you can use this table to determine if incident got submitted as part of some record producer
Based on that you can set the type. Query that table with your sysId
sc_item_produced_record
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 08:10 AM
I tried with after Insert Business Rule:
(function executeRule(current, previous /*null when async*/) {
var itemProducedRecord = new GlideRecord('sc_item_produced_record');
itemProducedRecord.addQuery('task', current.number);
itemProducedRecord.query();
if (itemProducedRecord.next()) {
current.contact_type = 'self-service';
} else {
current.contact_type = 'phone';
}
current.update();
})(current, previous);
but it doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 08:23 AM
use this -> you should query with current.sys_id and not current.number
(function executeRule(current, previous /*null when async*/) {
var itemProducedRecord = new GlideRecord('sc_item_produced_record');
itemProducedRecord.addQuery('task', current.sys_id);
itemProducedRecord.query();
if (itemProducedRecord.next()) {
current.contact_type = 'self-service';
} else {
current.contact_type = 'phone';
}
current.update();
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2025 08:50 AM
I've changed but still doesn't work