setting alert message when incident priority is changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2016 10:34 AM
suppose initially my priority is set and after that i change the priority. After i change the priority,it will display in the worknotes that priority is changed from high to low(if it is changed from high to low) and priority is lowered if priority is changed from high to low

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2016 10:45 AM
It is unclear what you are trying to accomplish. Are you wanting the changes in priority to be captured in the activity log? Are you wanting an alert when the priority changes? Is this alert only to occur when the priority is lowered? If the desired behavior is to show an alert, then look into leveraging an onChange client script:
Client Scripts - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2016 11:11 PM
Thanks Christopher.
Yes i am trying to capture it in worklogs.
So,when priority is changed from high to low,it will show "priority is lowered" in worklogs
Similarly,when priority is changed from low, to high,it will show "priority is increased" in worklogs

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2016 06:51 AM
What you will want to do is create an onBefore Business Rule. This business rule will be triggered by the condition where the priority changes: current.priority.changes()
In the script portion of the business rule, use the following:
function onBefore(current, previous) {
var pAction = 'increased';
if (current.priority > previous.priority) {
pAction = 'lowered'
}
current.work_notes = 'Priority is ' + pAction;
}
What this does is check the value of the priority field. Since priority uses numbers for its values, we compare the previous value to the current value. For example, let us say that a Low priority has a value of 2 and a High priority has a value of 1. If we change from a High to a Low, 2 is greater than 1, therefore the action is set to be lowered.
Let me know if you have any questions,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2016 01:18 PM
Hi,
Any thoughts on how you would use the same logic to prompt a user to update a work notes field when a priority changes?
Lorenzo