Help in Scripting if(gr.next()) is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-26-2019 11:44 PM
After madrid upgrade this script is not working in prod, the same is working in kingston.
Below code is displaying description of incident on approval request in portal but description is not getting visible after madrid upgrade only for incident.
kindly guide if anything wrong in it.
if (record.source_table == 'incident') {
gs.log("Madrid Changes hello");
var inc = new GlideRecord('incident');
inc.addQuery('sys_id', record.sysapproval.sys_id.toString());
gs.log("Madrid Changes variable" + record.sysapproval.sys_id.toString());
inc.query();
if (inc.next())
{
gs.log("Madrid changes dsc" + inc.description.toString());
ticket.description = inc.description.toString();
ticket.comment_approval = 'true';
}
}
Logs are not coming inside if (inc.next()) and if I remove the IF condition value is not coming in inc.description.toString();
In sort inc.description.toString(); is not working as well.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2019 02:23 AM
NO luck same result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2019 02:28 AM
Madrid hellof6ddedabdb617b40c4759ef7db96197f |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2019 02:33 AM
is it possible to share your screen on webex ? i can try to help you quickly.
did you hard-cord the sysid in your script and this has also not work on portal ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2019 02:51 AM
No i don't have webex,cant share . Yes tried by hardcoding sysid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā05-27-2019 01:10 AM
Hi,
Can you try printing the rowcount log once, after inc.query().
Regards,
Omkar Mone.
www.dxsherpa.com