- 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-12-2016 01:33 PM
Hi David,
It looks like the INSERT and UPDATE buttons need to be checked or this rule will never get triggered.
Once you do that, it will only update the priority if another update is also made and it meets those conditions. It's not going to update automatically. So it your incoming ticket sits for 10 days, the priority will still be 2.
You might be more interested in a scheduled job to run periodically based on time, not someone making another update. (I sort of feel like a car salesman upselling you on ServiceNow functionality now.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2016 01:51 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2016 01:54 PM
Unfortunately, current isn't know to scheduled jobs. I'll build you something shortly. Just so I understand the requirements:
- Look through all active P2 incidents.
- If the data created is > 8 hours ago, upgrade it to P1
Is that it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2016 02:00 PM
Hi Chuck,
That would be amazing, thanks for the help.
- Look through all active P2 incidents
- If the incident has been a P2 for more than 8 hours raise to P1
- (So if the ticket was a p3 for a while and then becomes a p2 the timer only starts when the tickets a p2)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2016 02:07 PM
Here you go:
Adjust the periodicity as needed:
Here's the script so you don't have to retype, just copy/paste:
var inc = new GlideRecord('incident');
inc.addActiveQuery();
inc.addQuery('priority', 2);
inc.addQuery('sys_created_on', '>=', gs.hoursAgo(8));
inc.query();
while (inc.next()) {
inc.priority = 1;
inc.update();
}
And most importantly, TEST TEST TEST in pre-production. 🙂