Set Due Date on Request and RITM based on Delivery Time#1893
Closed
AnandMahajan2799 wants to merge 3 commits intoServiceNowDevProgram:mainfrom
Closed
Set Due Date on Request and RITM based on Delivery Time#1893AnandMahajan2799 wants to merge 3 commits intoServiceNowDevProgram:mainfrom
AnandMahajan2799 wants to merge 3 commits intoServiceNowDevProgram:mainfrom
Conversation
Sets the "due_date" for a Request Item (RITM) based on delivery time set on catalog item record.
Follows the below step to calculate and set value:
1) Reading the delivery time (in days) from the associated Catalog Item
2) Parsing the days component from the display value (e.g. "5 Days" - 5).
3) Adding those days to the record's creation date ("sys_created_on").
4) Writing the calculated date to "due_date".
Sets the "due_date" on a Request with associated RITM with the highest "due_date". Follows the below steps to calculate and set the field: 1) Finding the associated RITM with the highest "due_date". 2) Assigning the Request's "due_date" to match that RITM's "due_date".
CreateD README file
WillemZeiler
requested changes
Oct 7, 2025
Contributor
WillemZeiler
left a comment
There was a problem hiding this comment.
Thank you for your submission. Your code is in conflict with OOTB SLA functionality and will therefore not be merged. If you feel your script handles a specific case that cannot be handled with OOTB SLA's feel free to update the Readme and submit the PR.
|
|
||
| **Benefits:** | ||
| - Ensures accurate due dates for both RITMs and Requests. | ||
| - Improves SLA tracking and reporting. |
Contributor
There was a problem hiding this comment.
A BR calculating due date is actually not enhancing SLA tracking. As you are not using SLA's in your code, it has a risk of even conflicting with OOTB SLA functionality
| * When: before insert | ||
| * | ||
| * @description | ||
| * Sets the "due_date" for a Request Item (RITM) by: |
Contributor
There was a problem hiding this comment.
The described process is already available with OOTB SLA's.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description:
Created business rules to set due dates on Requested Items (RITMs) and Requests based on the delivery time defined in catalog items.
Key Changes (Business Rules):
Set Due Date on RITM : A Before Business Rule on the sc_req_item table calculates and sets the due date by adding the catalog item's delivery time to the current date.
Set Due Date on Request : A Before Business Rule on the sc_request table sets the due date as the latest due date among all associated RITMs.
Note: Keeping both files in same sub-folder as these are related with each other.
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions