We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d1eee5 commit 5ae2a56Copy full SHA for 5ae2a56
Server-Side Components/Background Scripts/Update Field Based on Another Table’s Data/Script.js
@@ -0,0 +1,11 @@
1
+var userGr = new GlideRecord('sys_user');
2
+userGr.query();
3
+while (userGr.next()) {
4
+ var incGr = new GlideRecord('incident');
5
+ incGr.addQuery('caller_id', userGr.sys_id);
6
+ incGr.query();
7
+ while (incGr.next()) {
8
+ incGr.u_department = userGr.department; // Assuming custom field u_department
9
+ incGr.update();
10
+ }
11
+}
0 commit comments