Auto populate short Description of Request with short description variable of requested item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2022 05:31 AM
Hello , I have made a requested item with a var short description. I want when a user writes something in short description and press submit, automatically this short description to populate request's short description. I tried this BR on table requested_itemand works ok, BUT it disappears the requested item.
(function executeRule(current, previous /*null when async*/) {
var req = current.request.getRefRecord();
req.short_description = current.short_description;
req.update();
})(current, previous);
as you can see, its empty. normally it should have the requested item. But as long as BR is active, it doesn't show it to me. When BR is not active, Requested item appears normaly.
thank u!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2022 06:22 AM
hello @Vasilis Anastas can you try this script in an after insert business rule on RITM table
var req = new GlideRecord('sc_req_item');
req.addQuery('sys_id',current.sys_id);
req.query();
if(req.next())
{
req.short_description = current.variables.short_description;
req.update();
}
Hope this helps
Mark the answer correct if it helps you
Thanks