- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 12:49 AM
Hi,
In the RITM if i update the due date field, the SCTASK due date needs to automatically update the same.
Can anyone help here
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 01:19 AM
We can accomplish this by using Business Rules.
1. Navigate to Business Rules and select "Create New Business Rule."
2. Choose "Request Item" [sc_req_item] and set it as an After Business Rule.
3. In the "When to Run" section, select "Due Date is Modified." Then, write the script as follows:
(function executeRule(current, previous /*null when async*/) {
if (current.due_date != previous.due_date) {
var scTaskGr = new GlideRecord('sc_task');
scTaskGr.addQuery('request_item', current.sys_id);
scTaskGr.query();
while (scTaskGr.next()) {
scTaskGr.due_date = current.due_date;
scTaskGr.update();
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 12:55 AM
Where are you stuck on this?
You can make a simple flow or BR on change of the due date, look up the sctasks and set that due date to the same.
What did you already try and what isn't working?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 01:19 AM
We can accomplish this by using Business Rules.
1. Navigate to Business Rules and select "Create New Business Rule."
2. Choose "Request Item" [sc_req_item] and set it as an After Business Rule.
3. In the "When to Run" section, select "Due Date is Modified." Then, write the script as follows:
(function executeRule(current, previous /*null when async*/) {
if (current.due_date != previous.due_date) {
var scTaskGr = new GlideRecord('sc_task');
scTaskGr.addQuery('request_item', current.sys_id);
scTaskGr.query();
while (scTaskGr.next()) {
scTaskGr.due_date = current.due_date;
scTaskGr.update();
}
}
})(current, previous);