- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2016 06:16 AM
Hi,
I'm trying to set up a rule that if a user selects a specific category the priority will be set at a specific value. E.g Subcategory = Phishing Email, Priority = 2 - High
I think what I need to do is create a custom data lookup table & definition record and then a client script
Am I going about this the right way, or am I wrong and there's a better way to do this?
Thanks
Shona
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2016 07:59 AM
Try this client script:
Table: Incident
Type: OnChange
Field Name: subcategory
Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'antivirus') {
g_form.setValue('impact', 1);
g_form.setValue('urgency', 1);
}
}
I just tested this on my dev instance, and it works as expected (sets priority to Critical). Obviously, you would need to modify for your proper subcategory value and impact/urgency values.
Hope that helps!
Cheers,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2016 07:36 AM
Hi Tim,
Yeah I was thinking that too, so am trying just to change the Impact field first.
If I were to use the example above from Mike, I think there may need to be some form of reference to the field Impact or should g_form.setValue('impact', 2) automatically set the value on the impact field to 2
I'm not an expert in Javascript, so learning as I go (hence, may take me a little longer)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2016 07:59 AM
Try this client script:
Table: Incident
Type: OnChange
Field Name: subcategory
Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
if(newValue == 'antivirus') {
g_form.setValue('impact', 1);
g_form.setValue('urgency', 1);
}
}
I just tested this on my dev instance, and it works as expected (sets priority to Critical). Obviously, you would need to modify for your proper subcategory value and impact/urgency values.
Hope that helps!
Cheers,
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 02:10 AM
Hi Tim,
Thanks for this, I think I had to set both the impact and urgency for this to take effect and this works perfectly
Thanks again for your help - seems a lot easier than creating custom tables!
Shona