Remediation Tasks with all stale or closed items not auto closing Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Several Vulnerability Response Remediation tasks (VULs) are not auto closing - even though all the VITs in the task are closed Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } The close rollup only auto close groups where all the items (VITs) are in CLOSED state but reason (sub_state) need to be either "FIXED", "STALE", "EXCLUDED", "CANCELLED" or "ci_decommissioned"The logic of how the auto-close against Remediation Task happen once all VITs are closed is as below ***1. First, the VITs get updated to closed state with reasons then business rule "Closed-fixed roll up to group level" triggered and add the group to "sn_vul_update_manifest" table2. Later the VUL group will be closed by 'Rollup VI values to vulnerability, Remediation Task (RT), and VI count on RT' job where the job checks if all items are closed and update the group.3. Further debug on the back-end scripts below to find out how the roll up action done against VUL (remediation task).a)The state rollup scheduled job above will call script include RollupCalculatorUtil which calls the method _calculateVulnGroupRollups to validate the VITs within the VUL group record and called another script include "VulnerabilityGroup".------------------------------------------------------------------------_calculateVulnGroupRollups: function(groupId, excludeDeferred, checkState) {var group = new GlideRecord("sn_vul_vulnerability");if (!group.get(groupId))return;if (!group.active)return;var vgUtil = new sn_vul.VulnerabilityGroup(group);if (vgUtil.checkForEmptyGroup()) {new sn_vul.VulnerabilityUtils().resetCountsOnVG(group);if (group.getValue("filter_type") != "created_by_aer")vgUtil.closeGroupWithNoItems(true);} else if (checkState) {if (group.getValue("filter_type") != "created_by_aer")vgUtil.closedFixedGroupIfItemsClosedFixed(true);vgUtil.updateResolvedGroupIfItemsReopen();//Defer the group if all associated VIT's are in deferred state.vgUtil.deferGroupIfAllItemDeferred();}this.inlineCalculateRollup(group, excludeDeferred);// Save all updates. This function is smart enough not to do an update if there are no changesgroup.update();return;},------------------------------------------------------------------------b) Finally in the VulnerabilityGroup script include below for the method closedFixedGroupIfItemsClosedFixed you will see the logic how system check the VIT state and reason (sub_states) in order to decide whether the VUL group should be auto closed or not.------------------------------------------------------------------------var existingM2m = new GlideRecord("sn_vul_m2m_vul_group_item");existingM2m.addQuery("sn_vul_vulnerability", this.groupGr.getUniqueValue());existingM2m.addQuery("sn_vul_vulnerable_item.state", "!=", this.STATES.CLOSED).addOrCondition("sn_vul_vulnerable_item.substate", "!=", this.SUB_STATES.FIXED);existingM2m.addQuery("sn_vul_vulnerable_item.state", "!=", this.STATES.CLOSED).addOrCondition("sn_vul_vulnerable_item.substate", "!=", sn_vul.StateUtils.SUB_STATES.STALE);existingM2m.addQuery("sn_vul_vulnerable_item.state", "!=", this.STATES.CLOSED).addOrCondition("sn_vul_vulnerable_item.substate", "!=", sn_vul.StateUtils.SUB_STATES.EXCLUDED);existingM2m.addQuery("sn_vul_vulnerable_item.state", "!=", this.STATES.CLOSED).addOrCondition("sn_vul_vulnerable_item.substate", "!=", sn_vul.StateUtils.SUB_STATES.CI_DECOMMISSIONED);existingM2m.addQuery("sn_vul_vulnerable_item.state", "!=", this.STATES.CLOSED).addOrCondition("sn_vul_vulnerable_item.substate", "!=", sn_vul.StateUtils.SUB_STATES.CANCELLED);------------------------------------------------------------------------Per the script logic above, for a VUL group record to be auto-closed, all the VITs have to be closed and the reason (sub_state) need to be in certain value in order for the auto closure happen.