- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 02:16 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 03:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 02:19 AM
database.query('u_application', 'name', appname); ---> database.addQuery('u_application', <operator>, appname); change to this. This may be causing the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 02:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 02:58 AM
Please share some details
1) appname holds sysId or name
2) supported_by on cmdb_ci_database is reference type then does sup variable hold same table sysId
try this once
(function executeRule(current, previous /*null when async*/) {
var appname = current.name; // name string
var sup = current.supported_by.toString(); // supported_by referenc
var database = new GlideRecord('cmdb_ci_database');
database.addQuery('u_application', appname);
database.query();
while(database.next()){
database.supported_by = sup; // supported_by referenc
database.update();
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 03:05 AM