- 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-20-2023 03:56 AM
Hi Praneeth,
Thank you for the help. But can this be made easier? Like directly getting the values from Table and writing a Reference qual or Variable attributes?
Thanks,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 08:55 AM
Hi,
Onchange Client Script,
OnLoad Client script,
This worked.
Thanks & Regards,
Vaishnavi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2024 10:01 PM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {