- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 04:06 AM - edited 11-06-2023 04:10 AM
HI,
When we set the state to on hold and on hold reason field to any one option, then we want to populate the date/time on "On Release" field level.
During the process, when we change the on hold reason field to any other options without changing the state from on hold then we don't want to change the populated date/time.
And the populated the time should change only when we change the state from on hold.
We wrote the below business rule to run when state changes to on hold and it's working fine.
Now the requirement is we don't want to populate date/time when the "on hold reason" field option is either A or C.
Can anyone please help us to adjust the below script to skip the date/time.
(function executeRule(current, previous /*null when async*/ ) {
//functionality configurations
var tz = "America/New_York";
var hours = 48;
var rightNow = new GlideDateTime();
var dur = new GlideDuration(3600000 * hours);
var schedule = new GlideSchedule('021479371bdb99d04649c845604bcb58', tz);
var releaseDT = schedule.add(rightNow, dur);
current.u_hold_release = releaseDT;
})(current, previous);
Thanks,
LARA REDDY
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 02:04 AM
HI Lara,
Hope the below script helps you.
AR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2023 05:47 AM
Hi @LaraReddy
Can you give a try to this requirement using a SLA , because once the SLA has triggered you can always get the start time from SLA.
Please mark helpful and correct if my response helped you.