Need to show popup on incident pages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 09:42 AM
Hi Team
I'm currently working on a project and encountering some difficulties. I need to implement a feature where a button is displayed on incident pages, and upon clicking it, a popup should appear.
Please help and suggest how can achieve it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 03:40 PM
There are several thread which can help you create a UI page to display the pop-up. You can use the solution based on your requirements.
https://www.servicenow.com/community/developer-articles/custom-ui-page-in-a-popup/ta-p/2319550
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2024 05:15 PM
Hi @admin110 ,
Please modify below according to your requirement:
function resolveIncidents() {
var answer = confirm("Please ensure workaround field has been updated before resolving related incidents.");
if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'resolveincidents');
} else {
return false;
}
}
if (typeof window == 'undefined')
resolveIncidentFunction();
function resolveIncidentFunction() {
var incident = new GlideRecord("incident");
incident.addQuery("problem_id", "=", current.sys_id);
incident.addQuery("incident_state", "=", IncidentState.AWAITING_PROBLEM);
if ((typeof IncidentReason) !== "undefined")
incident.addQuery("hold_reason", "=", IncidentReason.AWAITING_PROBLEM);
incident.query();
while (incident.next()) {
incident.incident_state.setValue(IncidentState.RESOLVED);
incident.close_notes = 'This incident is resolved based on workaround provided in related problem investigation number ' + current.number + '.' + ' The Workaround is ' + '(' + current.work_around + ')';
incident.close_code = 'solved_workaround';
incident.update();
gs.addInfoMessage(gs.getMessage('Related Incidents Resolved'));
action.setRedirectURL(current);
}
}If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
