- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 06:06 AM
I have a ServiceNow business rule that is supposed to set the "warranty_expiration" field of a CMDB CI item based on the end date of a related contract. The script runs without errors, and I can see the log entries indicating that it should be updating the field.
However, the field is not being updated as expected.
I've double-checked the script, field and table names, permissions, and conditions, but I can't figure out why it's not working.
Could someone please help me troubleshoot this issue and provide suggestions on what might be going wrong? Thank you in advance!
Business rule runs on Insert and Update :
current.ci_item.warranty_expiration = new GlideDateTime(current.contract.ends.getValue());
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 08:27 PM
when is the BR running?
you are not using the script I shared above
var rec = new GlideRecord('cmdb_ci');
if(rec.get(current.ci_item)){
rec.warranty_expiration = new GlideDateTime(current.contract.ends);
rec.update();
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 08:27 PM
when is the BR running?
you are not using the script I shared above
var rec = new GlideRecord('cmdb_ci');
if(rec.get(current.ci_item)){
rec.warranty_expiration = new GlideDateTime(current.contract.ends);
rec.update();
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader