please let me know any mistake in below code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
please let me know any mistake in below code because still it's not working
var reqfor = ritm.variables.requested_for;
var query = 'model.short_descriptionINSFW100,SFW102^install_status=1^assigned_to=' + reqfor;
var grService = new GlideRecord('u_alm_service');
grService.addEncodedQuery(query);
grService.query();
if (grService.next()) {
var ci = new GlideRecord('u_cmdb_ci_service_github_subscription');
ci.addQuery('assigned_to', grService.assigned_to);
ci.query();
if (ci.next()) {
ci.u_msdn = true;
ci.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
@mani55
Could you please share what is your requirment ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
model field name is correct within the table u_alm_service?
Should it not be u_model since it's a custom table?
assigned_to is correct field within table u_cmdb_ci_service_github_subscription
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @mani55
Add gs.log and check which line is failing.
Also for testing after query() , add gs.log("row count:::::", grService.getRowCount());
Also if it returns multiple records, you can see only 1 record as instead of While you have used if.
if (grService.next()) {
