- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2015 11:28 AM
Hello,
In our environment, when an incident in pending user Info state, it becomes active only if the requester replies to the system email. Is there a way to make the state as active if a person on watch list also replies on the ticket.
We use the following business rule. How can I can I loop of the watch list and make ticket active when one of them replies.
if (current.sys_updated_by == current.u_requested_by.user_name
{
current.state = 2; //active state
}
Thanks for your looking and your suggestions.
Regards,
Shalini
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2015 08:40 PM
I would place it in the inbound email script given your requirements. Otherwise any update to the ticket will kick it out of Pending User Info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2015 01:36 PM
Hi skapoor
You should be able to modify the condition there:
var arrayUtilWL = new ArrayUtil();
if (current.sys_updated_by == current.u_requested_by.user_name || arrayUtilWL.contains(current.watch_list, current.sys_updated_by) )
{
current.state = 2; //active state
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2015 09:16 PM
Thanks Andrew for replying. I tried your code, but the contains method returns false, even tough the user account is in the watch-list. What is the best way to test it in the test environment.
Thanks for your help!
Shalini
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2015 01:38 PM
The simplest way would be to have the condition of to call the look up through a script include, so that it only runs when that condition is hit. If not wanting to use a condition, this should work.
if(current.sys_updated_by == current.u_requested_by.user_name || (!current.watch_list.nil() && isWatcher(current.watch_list)){
current.state = 2;
}
function isWatcher(watchers){
watchers = watchers.toString();
for(i = 0; i < watchers.length; i++){
var gr = new GlideRecord('sys_user');
gr.get(watchers[i]);
if(current.sys_updated_by == gr.user_name){
return true;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2015 09:13 PM
Thank you Mike for your reply.
I tried the code, but conditions for watchlist is coming out to be false even though the user is in the watchlist. I am testing using a test account that I've put in the watchlist. I am not sure why.
BR
Shalini