- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 03:00 AM
I want to create a change model for low risk. If risk is not low then it should give a message that "this change model is for low risk change". and change can't progress to the approval state.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 04:26 AM
I have already created a before update BR. Where the condition is Risk is not low and Risk is not empty.
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 03:11 AM
Hi @Gulfam Shafee3 ,
You can create a BR:
(function executeRule(current, previous /* previous() if it is an async business rule */) {
if (current.risk == 'Low') {
gs.info('Change ' + current.number + ' is low risk. Proceeding to approval.');
} else {
current.state = 'Review';
current.update();
gs.addErrorMessage('This change model is for low risk changes only.');
}
})(current, previous);
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 03:19 AM
Hi Sohail,
Thank you for quick response, I have already created a before update BR. Where the condition is Risk is not low and Risk is not empty.
Script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 04:26 AM
I have already created a before update BR. Where the condition is Risk is not low and Risk is not empty.
Script: