var attachment_link = ''; var rec = new GlideRecord('incident'); rec.addQuery('sys_id', "dc90eab4472139100d901d98036d4320"); rec.query(); if(rec.next()){ if(rec.hasAttachments()){ attachment_link = gs.getProperty('glide.servlet.uri') + rec.getLink(); gs.print(attachment_link) } }
How to Retrieves the link for the current record ServiceNow