Why Requested For is auto populating incorrectly in Request summary and RITM record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:24 AM
Hi Community,
I created a request for Aaron Shelly from portal and submitted the form.
After Submitting the form,in Request Summary showing Requested For as incorrect user name.
In platform,for REQ Requested For is showing correct.
but for RITM,its showing incorrect user name.
Could anybody please help with this issue?
Thanks,
Ankita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:43 AM
Hi,
I think requested for is a custom field on RITM.
Because as per the screenshot both are having different values and if it is coming from the request form then both should have the same values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 03:52 AM
Hi,
that might be the case.
@Ankita - check if the field on RITM form is dot walked from request field or custom field?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 04:19 AM
Hi Ankur,
In REQ,requested for is populating correctly.But in RITM,its populating as requestors name.
So for this I created a before business rule for RITM but still it's not working.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('request', current.sys_id);
grRITM.query();
while (grRITM.next()) {
if (!JSUtil.nil(grRITM.variables.requested_for)) {
current.requested_for = grRITM.variables.requested_for; //I am assuming requested_for variable here from form.
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 04:30 AM
Hi Ankita,
Did you check requested for is a custom field or rendering from Request table?
Instead of writing a business rule, place this script in the catalog item workflow.
Try this script,
if (current.variables.requested_for) {
current.requested_for = current.variables.requested_for.toString(); //I am assuming requested_for variable here from form.
}
Note: The same script works in the business rule also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 04:38 AM
Hi Balaji,
Requested For is OOB field.In the workflow,run script is setting the requested for value.