
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2015 10:13 AM
I have created a variable "Call counter" and another variable "Increment call" (which is a checbox), Here is my sceanrio:
1) Customer calls SD to have a ticket opened for an issue,
2) An hour later the customer calls back for a status, at this time the analysts checks the "increment call" button, the call counter starts at "0" and is suppose to increase each time the customer calls back.
3) So I need the call count value to be saved, I need the increment call option to be unchecked after the incident is updated, and I need the call counter value to increase by 1 the next time someone goes into that incident and clicks that increment call checkbox again.
Hope that makes sense.
Karen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2015 10:25 AM
a before business rule would work for this i believe.
if(current.u_increment_call == true){
var count = current.u_call_counter;
current.u_call_counter = count + 1; // add one to the count
current.u_increment_call = 'false'; // reset the count increment flag
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2015 11:11 AM
Ok, I implemented this on the demo012 instance for incidents as well.
Make sure that your Call Counter field is an Integer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2015 11:07 AM
https://demo012.service-now.com/login.do
user: admin
pass: admin
take a look at this record
Check the Increment Call box and then save the record, you will see the value in call counter incremented.
Below is the code i used:
Business rule: Increment Call Count
Check the following boxes: Advanced, Update
Script
if(current.u_increment_call == true){
var count = current.u_call_counter;
current.u_call_counter = count + 1; // add one to the count
current.u_increment_call = 'false'; // reset the count increment flag
}
Alex

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2015 09:05 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2015 09:11 AM
I can't even seem to get to the demo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2015 09:16 AM
the instance gets wiped daily (i believe) check again now. I have re-implemented this. Here