openGlideRecord in Declarative action for service operation workspace is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 06:28 AM
hi,
i have used Declarative Action for Service Operation Workspace, to create new incident.
issue: newly created incident is not opening in new tab. code : action.openGlideRecord(inc);
var canCreateIncident = false;
if ((current.isNewRecord() && current.canCreate()) || (!current.isNewRecord() && current.canWrite()))
canCreateIncident = current.update();
else
canCreateIncident = true;
if (canCreateIncident) {
var inc = new GlideRecord("incident");
inc.initialize();
inc.caller_id = current.opened_for;
inc.short_description = current.short_description;
if (GlidePluginManager.isActive("sn_itsm_gen_ai") && current.chat_summary && (current.chat_summary.toString()).length < 4000) {
inc.description = current.chat_summary;
}
inc.origin_table = "interaction";
inc.origin_id = current.sys_id;
if (gs.getProperty("com.snc.incident.create_from_interaction.save") === 'true') {
inc.work_notes = gs.getMessage('Incident created from Interaction {0}', current.number);
var incSysId = inc.insert();
if (incSysId) {
var interactionRelatedGR = new GlideRecord("interaction_related_record");
interactionRelatedGR.initialize();
interactionRelatedGR.interaction = current.sys_id;
interactionRelatedGR.document_table = 'incident';
interactionRelatedGR.document_id = incSysId;
interactionRelatedGR.insert();
}
}
action.openGlideRecord(inc);
new InteractionRelationshipUtil().copyAttachments(current, inc);
}
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 03:02 AM
Hi @Ujjwal1 ,
Could you please replace your action.openGlideRecord(inc) code with below:
action.openNewTab({
id: inc.sys_id,
table: 'incident',
view: 'workspace',
title: 'Incident ' + inc.number
});
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 05:42 AM
hi @pavani_paluri - thanks for reply. But solution did not work. it is not redirecting to new incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 05:57 AM - edited 07-03-2025 05:58 AM
Hi @Ujjwal1
Can you try this:
action.openNewTab({
id: inc.sys_id,
table: 'incident',
title: 'Incident ' + inc.number
});
Please try to log the incident sysid and check whats coming.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2025 06:30 AM
hi
i have tried this . still same issue
sys_id is returning Incident sys_id.