- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 10:11 AM - edited 02-17-2023 02:24 AM
Hi,
I have created 3 variables(Impact, Urgency and Priority) in a record producer.
I want priority to be populated depending upon the Urgency and Impact values. Basically it should drive Priority Matrix( Priority Data Lookup rules) and how it drives on the Incident form in the platform.
If anyone can help me with this?
Thanks,
Vaishnavi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 04:09 AM - edited 10-16-2023 04:37 AM
Hi @Vaishnavi35
If you want the priority variable choices has to be set based on the impact and urgency on record producer.
for that you can create two on change catalog client script for same record producer. and choose variable name impact for one CCS and urgency for another CCS.
Use this same script for both CCS and hope this will help you
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var impact = g_form.getValue('impact');
var urgency = g_form.getValue('urgency');
// Calculate the priority based on the Impact and Urgency values
if (impact == '1' && urgency == 'a') {
g_form.setValue('priority','critical');
} else if ((impact == '1' && urgency == 'b') ||
(impact == '2' && urgency == 'a')) {
g_form.setValue('priority','high');
} else if ((impact == '1' && urgency == 'c') ||
(impact == '2' && urgency == 'b') ||
(impact == '3' && urgency == 'a')) {
g_form.setValue('priority','moderate');
} else if ((impact == '2' && urgency == 'c') ||
(impact == '3' && urgency == 'b')) {
g_form.setValue('priority','low');
} else if (impact == '3' && urgency == 'c') {
g_form.setValue('priority','planning');
}
}
If you find this useful please mark my answer correct and helpful
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 10:55 AM
Hello @Vaishnavi35
Based on your requirement, the best I can think of is having an onchange client script.
So the onchange client script should be on the impact field.
The script should also validate the value of the urgency, and based on that the priority can be set.
A sample code that you can refer to is given below. You will have to change the field names accordingly.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
g_form.clearValue('candidate_id',true);
g_form.clearValue('u_employee_id',true);
var emptype = g_form.getValue('employement_type');
if(emptype=='employee'){
alert('onchange employee'+emptype);
g_form.setDisplay('candidate_id',true);
g_form.setDisplay('u_employee_id',true);
g_form.setMandatory('candidate_id',true);
g_form.setMandatory('u_employee_id',true);
}
if(emptype=='consultant' || emptype=='none'){
alert('onchange consultant'+emptype);
g_form.setMandatory('candidate_id',false);
g_form.setMandatory('u_employee_id',false);
g_form.setDisplay('candidate_id',false);
g_form.setDisplay('u_employee_id',false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 02:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 03:00 AM
Hi Vaishnavi,
Click here to view the thread that might help you on this issue.
if you find this useful do mark my answer Helpful
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2023 04:09 AM - edited 10-16-2023 04:37 AM
Hi @Vaishnavi35
If you want the priority variable choices has to be set based on the impact and urgency on record producer.
for that you can create two on change catalog client script for same record producer. and choose variable name impact for one CCS and urgency for another CCS.
Use this same script for both CCS and hope this will help you
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
var impact = g_form.getValue('impact');
var urgency = g_form.getValue('urgency');
// Calculate the priority based on the Impact and Urgency values
if (impact == '1' && urgency == 'a') {
g_form.setValue('priority','critical');
} else if ((impact == '1' && urgency == 'b') ||
(impact == '2' && urgency == 'a')) {
g_form.setValue('priority','high');
} else if ((impact == '1' && urgency == 'c') ||
(impact == '2' && urgency == 'b') ||
(impact == '3' && urgency == 'a')) {
g_form.setValue('priority','moderate');
} else if ((impact == '2' && urgency == 'c') ||
(impact == '3' && urgency == 'b')) {
g_form.setValue('priority','low');
} else if (impact == '3' && urgency == 'c') {
g_form.setValue('priority','planning');
}
}
If you find this useful please mark my answer correct and helpful
Thank you