From 6cd4cd003930da807440647d41fc4a0649bd5a8d Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Thu, 13 Oct 2022 22:34:31 +0530
Subject: [PATCH 01/10] Create script.js
---
Background scripts/script.js | 1 +
1 file changed, 1 insertion(+)
create mode 100644 Background scripts/script.js
diff --git a/Background scripts/script.js b/Background scripts/script.js
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/Background scripts/script.js
@@ -0,0 +1 @@
+
From dea746afbfa4ab042797614f8c59d03f0c131323 Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Thu, 13 Oct 2022 22:41:57 +0530
Subject: [PATCH 02/10] Delete Background scripts directory
---
Background scripts/script.js | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 Background scripts/script.js
diff --git a/Background scripts/script.js b/Background scripts/script.js
deleted file mode 100644
index 8b13789179..0000000000
--- a/Background scripts/script.js
+++ /dev/null
@@ -1 +0,0 @@
-
From 0b8b632b726a4704c8d6619a26360b1bd2408c38 Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Thu, 13 Oct 2022 22:45:07 +0530
Subject: [PATCH 03/10] Create Convert comma separated values in string to
columns
---
.../Convert comma separated values in string to columns | 1 +
1 file changed, 1 insertion(+)
create mode 100644 Useful-scripts/Convert comma separated values in string to columns
diff --git a/Useful-scripts/Convert comma separated values in string to columns b/Useful-scripts/Convert comma separated values in string to columns
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/Useful-scripts/Convert comma separated values in string to columns
@@ -0,0 +1 @@
+
From 3de4451138efcdaf00be703e88aa7af45ecc9fcb Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Thu, 13 Oct 2022 22:54:26 +0530
Subject: [PATCH 04/10] Delete Convert comma separated values in string to
columns
---
.../Convert comma separated values in string to columns | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 Useful-scripts/Convert comma separated values in string to columns
diff --git a/Useful-scripts/Convert comma separated values in string to columns b/Useful-scripts/Convert comma separated values in string to columns
deleted file mode 100644
index 8b13789179..0000000000
--- a/Useful-scripts/Convert comma separated values in string to columns
+++ /dev/null
@@ -1 +0,0 @@
-
From b0fadf463ace47b2704558e92b8bc9078f864938 Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Sun, 8 Oct 2023 00:23:31 +0530
Subject: [PATCH 05/10] Create MID Server availability inside MID cluster.js
---
.../MID Server availability inside MID cluster.js | 10 ++++++++++
1 file changed, 10 insertions(+)
create mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
new file mode 100644
index 0000000000..c14bd1f1cc
--- /dev/null
+++ b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
@@ -0,0 +1,10 @@
+var flag = 0; //initial flag to 0
+ var glideCluster = new GlideRecord('ecc_agent_cluster_member_m2m'); //m2m table stores cluser and all the midserver relation
+ glideCluster.addQuery('cluster', "sys_id of the cluster"); //replace "sys_id of the cluster" with sys_id of the MID server cluster
+ glideCluster.query();
+ while(glideCluster.next()){
+ if(glideCluster.agent.status=='Up'){
+ outputs.flag = 1; //if any one MID server is up proceed next step in the integration
+ break;
+ }
+ //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team
From bd82bd4e19998ea1bc6c9c18af3892f8fa3cee1e Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Sun, 8 Oct 2023 00:31:03 +0530
Subject: [PATCH 06/10] Create reame.md
---
.../reame.md | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/reame.md
diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md b/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md
new file mode 100644
index 0000000000..1c0f688507
--- /dev/null
+++ b/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md
@@ -0,0 +1,7 @@
+During integration set up with flow designers which involves MID servers , its better to check if MID server is up and running before we proceed with next steps in the integration.
+when we are using MID Server cluster (where more than one MID server as a failover) its recommended to verify if atleast one MID server is up and establish the connect
+MID server status inside cluster.js logic check if atleast one MID server is up if yes process next step in the integration if not abort the integration (we can have process to inform concered team)
+example flow action :
+where "inputs.midServerCluster.sys_id" is Cluster sys_id as input to the action
+
+
From e6d6fd179fa2d17d25c7b051766f7b0cf6c51d3d Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Sun, 8 Oct 2023 00:34:50 +0530
Subject: [PATCH 07/10] Update MID Server availability inside MID cluster.js
---
.../MID Server availability inside MID cluster.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
index c14bd1f1cc..304b03aeb1 100644
--- a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
+++ b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
@@ -7,4 +7,4 @@ var flag = 0; //initial flag to 0
outputs.flag = 1; //if any one MID server is up proceed next step in the integration
break;
}
- //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team
+ //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team.
From 4c241247b6f4e457bfe64796d031524936fb89b1 Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Sun, 8 Oct 2023 00:44:18 +0530
Subject: [PATCH 08/10] Delete Flow Actions/Check MID Servers status inside MID
Server cluster directory
---
.../MID Server availability inside MID cluster.js | 10 ----------
.../reame.md | 7 -------
2 files changed, 17 deletions(-)
delete mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
delete mode 100644 Flow Actions/Check MID Servers status inside MID Server cluster/reame.md
diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js b/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
deleted file mode 100644
index 304b03aeb1..0000000000
--- a/Flow Actions/Check MID Servers status inside MID Server cluster/MID Server availability inside MID cluster.js
+++ /dev/null
@@ -1,10 +0,0 @@
-var flag = 0; //initial flag to 0
- var glideCluster = new GlideRecord('ecc_agent_cluster_member_m2m'); //m2m table stores cluser and all the midserver relation
- glideCluster.addQuery('cluster', "sys_id of the cluster"); //replace "sys_id of the cluster" with sys_id of the MID server cluster
- glideCluster.query();
- while(glideCluster.next()){
- if(glideCluster.agent.status=='Up'){
- outputs.flag = 1; //if any one MID server is up proceed next step in the integration
- break;
- }
- //else returns 0 and no MID server are up inside the cluster, abort integration logic and report to the concerened team.
diff --git a/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md b/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md
deleted file mode 100644
index 1c0f688507..0000000000
--- a/Flow Actions/Check MID Servers status inside MID Server cluster/reame.md
+++ /dev/null
@@ -1,7 +0,0 @@
-During integration set up with flow designers which involves MID servers , its better to check if MID server is up and running before we proceed with next steps in the integration.
-when we are using MID Server cluster (where more than one MID server as a failover) its recommended to verify if atleast one MID server is up and establish the connect
-MID server status inside cluster.js logic check if atleast one MID server is up if yes process next step in the integration if not abort the integration (we can have process to inform concered team)
-example flow action :
-where "inputs.midServerCluster.sys_id" is Cluster sys_id as input to the action
-
-
From 3ecedaabd6b8700c29d841b4675e2a7e70d52daf Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Sun, 5 Oct 2025 17:05:26 +0530
Subject: [PATCH 09/10] Create FlowAction.js
---
.../FlowAction.js | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)
create mode 100644 Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/FlowAction.js
diff --git a/Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/FlowAction.js b/Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/FlowAction.js
new file mode 100644
index 0000000000..b9fc82080e
--- /dev/null
+++ b/Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/FlowAction.js
@@ -0,0 +1,46 @@
+(function execute(inputs, outputs) {
+ // ... code ...
+
+ //Get Source ids from existing Attestation;
+ //Check if an assessable record exists for all attestations in the group if not, throw an error message.
+ var sources = '';
+ var asmtmetricType = inputs.metricType; //Assessment metric type sys_id
+ var asmtAssignee =inputs.AttestationAssignee.sys_id.toString(); //Assessment assignee.
+ var assessmentList =inputs.AttestationList.trim(); //comma separated individual assessment.
+
+ var asmt = new GlideRecord("asmt_assessment_instance"); //Assessment instance table
+ asmt.addQuery("sys_id", "IN", assessmentList);
+ asmt.query();
+ while (asmt.next()) { //Need this while loop to check 1)check state and Assessable record.
+ if ((asmt.state == "complete" || asmt.state == "canceled")) {
+ outputs.out = "can't proceed, Attestation states are in Complete or Canceled, Please review.";
+ return;
+ }
+ //for each assessment check if assessable record exist
+ var assessableRecord = new GlideRecord("asmt_assessable_record"); //assessment assessable table
+ assessableRecord.addQuery("source_id", asmt.sn_grc_item);
+ assessableRecord.query();
+ if (assessableRecord.next()) {
+ sources = sources + "," + asmt.sn_grc_item;
+ } else {
+ outputs.out = "can't proceed, Assesssable record doesn't for this inntance please " + asmt.number + " review";
+ return;
+ }
+ }
+ sources = sources.slice(1); //Comma separated source sys_ids where assessment exist
+
+ //Create Grouped Attestation using below api
+ var result = new global.AssessmentUtils().createAssessments(asmtmetricType, sources + '', asmtAssignee, '');
+
+ //set grouped assessmemt as parent to all the instance
+ var asmtFinal = new GlideRecord("asmt_assessment_instance");
+ asmtFinal.addQuery("sys_id", "IN", assessmentList);
+ asmtFinal.query();
+ while(asmtFinal.next()){
+ asmtFinal.setValue("sn_grc_parent", result.split(',')[0]);
+ asmtFinal.update(); //set parent on to the each assessment
+ }
+
+ outputs.out = result.split(',')[0]; //return the grouped attestation instance id.
+
+})(inputs, outputs);
From b210bbc83512af07b193dad46e468c16a403d657 Mon Sep 17 00:00:00 2001
From: gowdah <42912180+gowdah@users.noreply.github.com>
Date: Sun, 5 Oct 2025 17:06:29 +0530
Subject: [PATCH 10/10] Create readme.md
---
.../readme.md | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/readme.md
diff --git a/Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/readme.md b/Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/readme.md
new file mode 100644
index 0000000000..8519671ab6
--- /dev/null
+++ b/Specialized Areas/Flow Actions/Group Similar Assessments Using Flow Designer Action Native UI/readme.md
@@ -0,0 +1,23 @@
+**Create a flow action with the inputs below:**
+
+
+
+Add the script from action.js file
+
+**Test and publish the action.**
+
+**Plug this into the appropriate flow where you need to group the attestation.**
+
+
+**Output:**
+
+**List of Sample Assessments**
+
+
+
+
+**Flow Context:**
+
+
+**Grouped Assessment:**
+