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-25-2025 07:51 PM
I think you should write the business rule on 'rm_release' table. Then query task table using ritm reference in rm_release table and update the custom field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-25-2025 08:41 PM
your business rule is on which table? I assume it's sc_task
update as this and see
(function executeRule(current, previous /*null when async*/) {
// Ensure the task is linked to an RITM
if (!current.request_item) {
return;
}
// Fetch the related RITM
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(current.request_item)) {
// Assuming the RITM has a reference field 'u_product_release' to Product Release
if (ritm.u_product_release) {
// Set the Task's Release field to the Product Release value from RITM
current.u_release = ritm.u_product_release;
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
ā05-27-2025 06:01 AM
Hi Ankur !
I see Product release in related list of RITM, but I am unable to get the reference field on RITM.When I check RITM table I don't see Product release in the table.As I have shared screenshot I could see Product Releases in RITM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2025 06:10 AM
is it a defined relationship?
If yes then on Product release table there must not be any field which refers to RITM
Share the complete related list screenshots.
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