javascript addQuery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2013 07:09 AM
Need some guidance on how to write a query in a client script.
I want to query a reference table for a specific record and then pull other attributes from that record along and update the current record.
Hope it makes sense.
Thanks
Phillip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2013 12:04 AM
Auto assignment based on the Support Group of the CI. I would like to get the CI "Support Group" and populate the "Assignment Group" field on an Incident with the value. I've seen a script to this effect but can't seem to find it anymore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2013 06:55 AM
Thanks Christopher, the script you provided works great. How do I align it with the whole "client script best practice" thing? I'm no developer so any help would be greatly appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2013 08:36 AM
This WIKI article should help you: http://wiki.servicenow.com/index.php?title=Client_Script_Best_Practices#Run_Only_Necessary_Scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2016 05:35 AM
Hi Phillip,
Can you share the script you used to auto assign based on the support group of the CI?
Auto assignment based on the Support Group of the CI. I would like to get the CI "Support Group" and populate the "Assignment Group" field on an Incident with the value. I've seen a script to this effect but can't seem to find it anymore.
Thank you,
Laura
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2016 06:44 AM
Hi Laura
Used the following script as base:
//Set Assignment Group to CI's support group if assignment group is empty
function onChange(control, oldValue, newValue, isLoading) {
if (!isLoading) {
if (newValue) {
if
(newValue != oldValue) {
if
(g_form.getValue('assignment_group' != '') {
var ciSupportGroup = g_form.getReference('cmdb_ci').support_group;
if (ciSupportGroup != '')
g_form.setValue('assignment_group', ciSupportGroup);
}
}
}
}
}
Hope it helps.