From 696deaa78b8f6daa9e9cb175b139f553e8937edb Mon Sep 17 00:00:00 2001 From: Apoorva Date: Thu, 15 Jun 2023 11:55:05 +0530 Subject: [PATCH] 1.0.6 --- ...clude_716c87ad471f1110328ca368436d438a.xml | 18 +++++++--------- ...clude_ba2b3da69769e510026f72021153af1b.xml | 2 -- ...clude_f60f0ee047131110328ca368436d43ba.xml | 21 +++++++++++++------ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Scripts/sys_script_include_716c87ad471f1110328ca368436d438a.xml b/Scripts/sys_script_include_716c87ad471f1110328ca368436d438a.xml index 5533398..38aff1d 100644 --- a/Scripts/sys_script_include_716c87ad471f1110328ca368436d438a.xml +++ b/Scripts/sys_script_include_716c87ad471f1110328ca368436d438a.xml @@ -1,5 +1,5 @@ - + public true @@ -15,7 +15,7 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application * passed individually to the VR AppVul API */ MSG: 'CheckmarxOne AppListProcessor:', - process: function(attachment) { + process: function (attachment) { if (!attachment) { gs.warn(gs.getMessage('CheckmarxOneAppListProcessor: Called with no attachment')); return; @@ -26,17 +26,16 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application appDoc.parseXML(new GlideSysAttachment().getContent(attachment)); var listNode = appDoc.getNode("/appInfoList/xml/projects"); var iter = listNode.getChildNodeIterator(); - if (iter.hasNext()) - iter.next(); + while (iter.hasNext()) { var appNode = iter.next(); var attributes = appNode.getAttributes(); //map attributes from Checkmarx into the servicenow expected format' var appObj = { source_app_id: attributes.id, - app_name: attributes.name, + app_name: attributes.id, source_assigned_teams: attributes.groups, - description: attributes.description, + description: appNode.getLastChild().getTextContent().toString(), }; //Updating the project information in ServiceNow table var result = this.AVR_API.createOrUpdateApp(appObj); @@ -48,8 +47,7 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application else if (result.unchanged) this.import_counts.unchanged++; } - if (iter.hasNext()) - iter.next(); + } } catch (ex) { errorMessage = gs.getMessage("Error in retriving data for app list integration!"); @@ -67,13 +65,13 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application admin 2022-11-21 12:03:00 716c87ad471f1110328ca368436d438a -44 +46 CheckmarxOneAppListProcessor 3d20e92d47471110328ca368436d436a 3d20e92d47471110328ca368436d436a sys_script_include_716c87ad471f1110328ca368436d438a apoorva.singh@checkmarx.com -2023-03-16 10:55:08 +2023-06-06 06:23:26 diff --git a/Scripts/sys_script_include_ba2b3da69769e510026f72021153af1b.xml b/Scripts/sys_script_include_ba2b3da69769e510026f72021153af1b.xml index 80b2372..7baaf1e 100644 --- a/Scripts/sys_script_include_ba2b3da69769e510026f72021153af1b.xml +++ b/Scripts/sys_script_include_ba2b3da69769e510026f72021153af1b.xml @@ -26,8 +26,6 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat var reportData = {}; if (listNode) { var iter = listNode.getChildNodeIterator(); - if (iter.hasNext()) - iter.next(); while (iter.hasNext()) { var node = iter.next(); reportData['source_app_id'] = node.getAttribute('app_id'); diff --git a/Scripts/sys_script_include_f60f0ee047131110328ca368436d43ba.xml b/Scripts/sys_script_include_f60f0ee047131110328ca368436d43ba.xml index 596e0ea..88c9e50 100644 --- a/Scripts/sys_script_include_f60f0ee047131110328ca368436d43ba.xml +++ b/Scripts/sys_script_include_f60f0ee047131110328ca368436d43ba.xml @@ -1,5 +1,5 @@ - + public true @@ -58,9 +58,18 @@ CheckmarxOneAppListIntegration.prototype = Object.extendsObject(sn_vul.Applicati for (var item in response.projects) { groups = +response.projects[item].groups.toString(); if (groups == 0) { - appListAll += ' '; + appListAll += '' + + '<' + '![CDATA[' + response.projects[item].name + ']]' + '>'; + } else { - appListAll += ' '; + appListAll += '' + + '<' + '![CDATA[' + response.projects[item].name + ']]' + '>'; } } @@ -88,7 +97,7 @@ CheckmarxOneAppListIntegration.prototype = Object.extendsObject(sn_vul.Applicati this.LATEST = latest; } } else { - this.LATEST = new GlideDateTime(this.DELTA_START_TIME || '1970-01-01T10:16:06.17544Z'); + this.LATEST = new GlideDateTime(); var projectJSON = this.UTIL.getNewProjectList(this.IMPLEMENTATION); var filteredCount = projectJSON.filteredTotalCount; if (filteredCount !== "undefined") { @@ -174,13 +183,13 @@ CheckmarxOneAppListIntegration.prototype = Object.extendsObject(sn_vul.Applicati admin 2022-11-18 05:11:38 f60f0ee047131110328ca368436d43ba -129 +131 CheckmarxOneAppListIntegration 3d20e92d47471110328ca368436d436a 3d20e92d47471110328ca368436d436a sys_script_include_f60f0ee047131110328ca368436d43ba apoorva.singh@checkmarx.com -2023-05-23 14:50:01 +2023-06-06 17:18:33