- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 04:43 AM
Set Incident Priority based on Business Criticality of a Service
Hi Guys, I'd really appreciate any help/guidance on an appropriate Script or Business Rule to use, to achieve the following:
My client has a requirement that the 'Priority' is auto-populated, based on the 'Business Criticality' that is associated to the 'Service' (cmdb_ci_service) that is selected by the User, all configured on the standard 'Incident' Form, on the 'Incident' Table.
Example, if the 'Business Criticality' associated with the 'Service' selected = '1 - most critical' then set the 'Priority' of the Incident to '1 - Critical'. etc
Example, if the 'Business Criticality' associated with the 'Service' selected = '3 - less critical' then set the 'Priority' of the Incident to '3 - moderate'. etc
How can I achieve this via Client Script or Business Rule and what would be an example of the Script or Business Rule details I need to achieve this please ?
Many thanks - any help greatly appreciated as always.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 05:09 AM
Hi @WazzaJC try onChange client script
function onChange(control, oldValue, newValue, isLoading) {
var caller = g_form.getReference('ReferenceFieldName', doAlert); // doAlert is our callback function
}
function doAlert(service) { //reference is passed into callback as first arguments
if (service.business_critically == '1')
{
g_form.setValue('priority','1');
}
else if (service.business_critically == '2')
{
g_form.setValue('priority','2');
}
else {
g_form.setValue('priority','3');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 04:57 AM
var service = g_form.getValue("service");
if(service == "1"){
g_form.setValue('priority', "1");
}
You need to write this in OnChange() Client Script.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 05:04 AM
Hi Samaksh,
I don't believe this correctly addresses my query - have you tried this on your PDI and it works? It does not work for me.
I am talking about Business Criticality associated with a Service which is then used to set the Priority, as per the details in my note.
Many thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 05:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2023 05:09 AM
Hi @WazzaJC try onChange client script
function onChange(control, oldValue, newValue, isLoading) {
var caller = g_form.getReference('ReferenceFieldName', doAlert); // doAlert is our callback function
}
function doAlert(service) { //reference is passed into callback as first arguments
if (service.business_critically == '1')
{
g_form.setValue('priority','1');
}
else if (service.business_critically == '2')
{
g_form.setValue('priority','2');
}
else {
g_form.setValue('priority','3');
}
}