- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 01:58 PM
Hi All,
I have a Record Producer which creates a Demand. The record producer has the Urgency and Impact values. When the record producer is submitted it creates a Demand where it create priority of the demand based on the Urgency & Impact values we select from the record producer. While the demand is getting created the priority is being calculated incorrect.
High/High is giving low priority. which is not correct.
FYI: 1) The priority is being calculated correctly when a demand is created manually but not from the Record producer.
2) we don't have priority field on the record producer.
please help.
Thanks,
SD
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 02:23 PM
You can use below script in the onBefore Insert business rule
current.priority = calculatePriority(current.impact, current.urgency);
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 02:11 PM
How is the Priority calculated when creating it manually? If it's not from a business rule I would guess there's some client script that is setting it based on the Impact/Urgency values. in that case you may have to replicate it in the the Record Producer script to set current.priority.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 02:18 PM
HI David,
Yes, we are using 2 onChange client scripts to calculate priority.
1) calculate priority onchange urgency
2) calculate priority onchange impact.
How can i use this script in RP?
Here is the script:
function onChange(control, oldValue, newValue, loading) {
var values = new Array();
values.push(g_form.getValue('impact') || 0);
values.push(g_form.getValue('urgency') || 0);
if (loading)
return;
var ga = new GlideAjax('ServiceAjax');
ga.addParam('sysparm_name','calculatePriority');
ga.addParam('sysparm_values', values);
ga.getXML(calcReturn0,null,'priority');
}
Thanks,
SD

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2017 02:13 PM