How can i create Ui action on incident List View that will update the record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 03:49 AM
Hi
I have one requirement where i want two button "ASSIGN ME" and "REMOVE ME" on incident list page.
and suppose i applied some filter condition on list page.
when i click "ASSIGN ME" then it will assign me as a assignee in all the record that return from the Filter condition applied on list page.
How can i do this please help me.
Thanks
Ankit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 04:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 04:13 AM
Hi @Ankit Kumar6 ,
I tried your problem in my PDI and it works for me please check below stetps
I created Client callable UI Action and addded below code
function assignIncident() {
var selected = g_list.getChecked();
alert('selected = ' + selected);
var ga = new GlideAjax('assignedIncidentList');
ga.addParam('sysparm_name', 'assignedIncidentListFunction');
ga.addParam('sysparm_selectedIds', selected);
ga.getXML(updateCampus);
function updateCampus(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
}
Script Include which is client callable
var assignedIncidentList = Class.create();
assignedIncidentList.prototype = Object.extendsObject(AbstractAjaxProcessor, {
assignedIncidentListFunction: function(){
var ids = this.getParameter('sysparm_selectedIds');
gs.log("sysparm_selectedIds" + ids);
var incGr = new GlideRecord('incident');
incGr.addEncodedQuery('sys_idIN'+ids);
incGr.query();
while(incGr.next()){
incGr.assigned_to = 'be05e21b937331100d5170918bba10c7';
incGr.update();
}
},
type: 'assignedIncidentList'
});
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2024 04:26 AM - edited 05-21-2024 04:27 AM
Hi @Community Alums , @Sid_Takali
I think you are only updating the selected record.
But my requirement is suppose i applied a filter condition and this will return 500 records, and when i click "ASSIGN ME" button then it will add me as a assignee in all 500 records.
I dont want to scroll the page and select the records