- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2016 12:37 PM
Hi All,
I'm new to world of service now and was looking for assistance on a business rule.
I'd like to make is to a priority 2 incident is raised to priority 1 eight hours after being raised/opened as a p2. I've tried many different tests within business rules but nothing seems to work (We are on Fuji)
When to run
When: Before
Order: 100
Filter Conditions
Active is true
Priority is 2 - High
Duration is Days 0 Hours 8
Actions
Urgency to 1 - High
Impact to 1 - High
Priority to 1 - Critical
The closest out of the box business rule is Incident State Active on Assignment which I've been playing around with a bit as well. Can someone offer some advice?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2016 01:42 PM
Change of approach. I built the list filter to get it the way I wanted, then copied the query and used it in the addEncodedQuery() method like this.
var inc = new GlideRecord('incident');
inc.addEncodedQuery('active=true^priority=2^sys_created_on<javascript:gs.hoursAgoStart(8)');
inc.query();
gs.log(inc.getRowCount() + ' records found');
while (inc.next()) {
inc.priority = 1;
inc.update();
}
I did not update your scheduled job or records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2016 02:23 AM
Hi Ctomasi.
Any luck with investigating that code?
I've tried swapping Priority to Urgency and other items but the same "0 tables found" result display's. I'm doing this all on a service now developer environment so I could possibly give you access to it if you like.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2016 05:59 AM
Sorry, I've been consumed with Knowledge16 for the past couple weeks. I've just requested to follow you. If you follow me back we can exchange credential information to that instance and I can take a look.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2016 01:22 PM
Hi Chuck,
No worries at all! I'll send you over the details shorly, thanks for the help again.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2016 01:42 PM
Change of approach. I built the list filter to get it the way I wanted, then copied the query and used it in the addEncodedQuery() method like this.
var inc = new GlideRecord('incident');
inc.addEncodedQuery('active=true^priority=2^sys_created_on<javascript:gs.hoursAgoStart(8)');
inc.query();
gs.log(inc.getRowCount() + ' records found');
while (inc.next()) {
inc.priority = 1;
inc.update();
}
I did not update your scheduled job or records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2016 02:49 PM
Hi Chuck,
Yes! its working! its really working!! Had to tweek the code a little bit more in the end. For some reason you can override proirty in a business rule but in a script it appears urgency and impact have to be raised instead.
var inc = new GlideRecord('incident'); | |
inc.addEncodedQuery('active=true^priority=2^sys_created_on<javascript:gs.hoursAgoStart(8)'); | |
inc.query(); | |
gs.log(inc.getRowCount() + ' records found'); | |
while (inc.next()) { |
inc.urgency = 1;
inc.impact = 1;
inc.update(); | |
} |