BR to autopopulate RITM value on incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 08:17 PM
I have created a custom field called REQUESTED ITEM(u_requested_item) in related records.
Now I have to autopopulate this field when a request is created from the incident.
I have used a Before BR:
Before - Insert&update
condition: current.sys_class_name == 'incident' && current.u_requested_item.nil()
Script:
(function executeRule(current, previous /*null when async*/) {
if (current.sys_class_name == 'incident' && current.request_item.nil()) {
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('request', current.sys_id);
ritm.query();
if (ritm.next()) {
current.request_item = ritm.sys_id;
}
}
})(current, previous);
For some reason its not populating.
Iam using UI action from incident to create a request.
Can anyone help on this?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 11:44 PM
you can already establish relationship between INC and RITM via REQ as REQ already has parent field populated with INC
why to have extra field on INC table?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 12:09 AM
@Ankur Bawiskar They have an idea to design a flow based on this custom variable as a part of next sprint. So we were trying to create one here and populate. Is there a way I can populate it? My BR above doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 11:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 12:08 AM
Hi @Swetham
To understand the situation better, Could you share the screenshot where you have created Incident and how are you creating Request from Incident? As I don't see any such process yet OOTB.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 12:11 AM
The Service desk team logs incident when they get calls from customers and they have a UI action on the incident form to create a Request from the same.