using ui action we need to create a button state to move closed
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2024 03:13 AM
Using UI actions, we must create a button state to move to the closed list level. Once I select the record, it should be updated to close.
Labels:
- Labels:
-
Incident Management
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2024 07:39 AM
You can follow this docs
OR
you can do a simple UI action like below image
Please mark my answer correct and helpful if this works for you.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2024 04:25 AM
It looks like you've written, "This code didn't work. I wrote a new code, and it's working correctly now."
function actionOK() {
var sysId = g_list.getChecked();
var inc = new GlideAjax('IncidentClosure');
inc.addParam('sysparm_name', 'closeIncidents');
inc.addParam('sysparm_incidents', sysId);
inc.getXML(serverData);
function serverData(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer === 'true') {
alert("short_description changes");
} else {
alert("Failed to close incidents");
}
}
}
var IncidentClosure = Class.create();
IncidentClosure.prototype = Object.extendsObject(AbstractAjaxProcessor, {
closeIncidents: function() {
var selectedIncidents = this.getParameter("sysparm_incidents");
var incidentGr = new GlideRecord('incident');
incidentGr.addQuery('sys_id', 'IN', selectedIncidents);
incidentGr.query();
while (incidentGr.next()) {
incidentGr.setWorkflow(false);
incidentGr.setValue('short_description','test');
incidentGr.setValue('state',2);
incidentGr.update();
}
return true;
},
type: 'IncidentClosure'
});