Business Rule to update custom Release field on Task with Requested Item Related List field Release
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-25-2025 07:23 PM - edited ā05-25-2025 07:24 PM
Hi
I am working on a business rule to Update custom field(Release- created by me on Task Table) to update with Task Related Request Item Related List field Product Release.
I want to make sure that once Release is linked with RITM,then Product Release value is updated on RITM and then with business rule make to update custom Release field value on Task.
I tried writing the business rule but unable to achieve the automation .
This is the business rule I am using
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2025 06:06 AM
Hi
@Siddharth Parna
Script
(function executeRule(current, previous /*null when async*/) {
// Make sure the task has a linked Request Item
if (current.request_item) {
var reqItem = new GlideRecord('sc_req_item');
if (reqItem.get(current.request_item)) {
// Now get the product release from RITM - assuming it's a reference field 'u_product_release'
if (reqItem.u_product_release) {
// Update the custom Release field on Task
current.u_release = reqItem.u_product_release;
} else {
// Clear the release field if no product release found
current.u_release = null;
}
}
}
})(current, previous);