- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 04:00 AM - edited 10-12-2022 04:01 AM
Hello Guys,
I have set up a business rule which looks for changes to the additional comments field and then updates a custom field I created "Last Customer Update" with the current date value.
This seems to be working well however I have overlooked the fact that when the end user add a comment it is updating the additional comments field which in turn is triggering the business rule.
Is there a way I can trigger my rule to run only when an internal engineer adds an additional comment and have it ignore anything made by the customer?
Solved! Go to Solution.
- Labels:
-
Service Desk

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 07:18 AM
Ofcourse possible, you need to add some code like below in your BR to update only if it belongs to company, please tweak accordingly.
var r = new GlideRecord('sys_user');
r.addQuery('user_id' , current.updated_by)
r.addQuery('company' , 'sys id of company'
r.query();
if(r.next())
{
current.customer flag = true;
}
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 05:42 AM
Hello,
Generally Additional comments is for End users communication and not for internal engineers, Internal folks can use 'Work notes' to communicate between other engineers, However in same BR you can simply add conditions like below, updated is different from requestor.user ID, you can tweak accordingly.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 06:20 AM
Hi,
Thank you for the reply, Additional comments are used by our engineers to provide the customer with an update on their case, but if the customer replies to an update, or chases a case, this update is triggering my flow. I'm trying to report on tickets that have gone a duration of time without a customer update from our engineers. The example is helpful however this will limit it to only the requestor being excluded, others within the end users company may also add updates to a given case.
Is it possible to set a condition that rule will trigger only if the person updating it is part of a company?
Thanks again
Craig

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2022 07:18 AM
Ofcourse possible, you need to add some code like below in your BR to update only if it belongs to company, please tweak accordingly.
var r = new GlideRecord('sys_user');
r.addQuery('user_id' , current.updated_by)
r.addQuery('company' , 'sys id of company'
r.query();
if(r.next())
{
current.customer flag = true;
}
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2022 09:20 AM
Thanks. I had to amend this slightly to meet our requirement:
var r = new GlideRecord('sys_user');
//var usr = current.updated_by;
var usr = gs.getUserID();
r.addQuery('sys_id' , usr);
var sysid = 'enter sysid here';
r.addQuery('company' , sysid);
r.query();
if(r.next()) {
current.u_last_customer_update = gs.now();
}