Resolve all button Issue
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 02:49 AM
Hi Experts,
I have written the below code for resolving the records based on the Vulnerability. when ever I click on the resolve all button only that record is getting closed but not the other records. Can anyone help with this.
Thanks in advance
function onClickResolveall() {
sn_vul.Modal.popupResolveAppItemModal();
var relatedItems = new GlideRecord('sn_vul_app_vulnerable_item');
relatedItems.addQuery('vulnerability', current.vulnerability);
relatedItems.addEncodedQuery('active=true^stateIN1,2');
relatedItems.query();
while (relatedItems.next()) {
relatedItems.state = 101; // Resolved state
relatedItems.resolution_reason = current.resolution_reason;
relatedItems.active = false;
relatedItems.update();
}
action.setRedirectURL(current);
}
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 06:07 AM
Are you getting multiple records using the query that you have in the gliderecord, try putting into gs.info logs to see if you finding multiple records in the query.
Best Regards
Aman Kumar
Aman Kumar