- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 06:15 AM
Hello!
We have a notification that is triggered when Additional comments changes. We have a new requirement to only send this type of notification when State is New/In Progress/On Hold. This works when the state is in New/In Progress/On Hold. It also sends the notification when there is an additional comment and the user clicks the Resolve button.
Is there a way to not send the notification when the State changes to Resolved and there is an additional comment?
Please help.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 08:19 AM
Hi @ceraulo ,
Hope you are doing great.
To restrict the notification when the state changes to resolved, follow below steps:
- Find the Business rule which is responsible for sending the notification when the "Additional comments" field changes.
- Enhance script logic to restrict the notification when state is resolved and additional comments is changed, referencing below script:
var currentState = current.state;
var additionalComments = current.additional_comments;
// Check if the state is in the allowed values (New, In Progress, or On Hold)
if (currentState == 'New' || currentState == 'In Progress' || currentState == 'On Hold') {
// Check if the state is Resolved and there are additional comments
if (!(currentState == 'Resolved' && additionalComments)) {
// Send the notification
gs.eventQueue('notification.send', current, 'additional_comments');
}
}
\
Regards,
Riya Verma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 08:19 AM
Hi @ceraulo ,
Hope you are doing great.
To restrict the notification when the state changes to resolved, follow below steps:
- Find the Business rule which is responsible for sending the notification when the "Additional comments" field changes.
- Enhance script logic to restrict the notification when state is resolved and additional comments is changed, referencing below script:
var currentState = current.state;
var additionalComments = current.additional_comments;
// Check if the state is in the allowed values (New, In Progress, or On Hold)
if (currentState == 'New' || currentState == 'In Progress' || currentState == 'On Hold') {
// Check if the state is Resolved and there are additional comments
if (!(currentState == 'Resolved' && additionalComments)) {
// Send the notification
gs.eventQueue('notification.send', current, 'additional_comments');
}
}
\
Regards,
Riya Verma