From 11739faba75691e3a280e195474e1364e91f2c8e Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 20:17:21 +0530 Subject: [PATCH 1/5] Create Readme.md --- .../Catalog Client Script/Multi-User Collaboration/Readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Client-Side Components/Catalog Client Script/Multi-User Collaboration/Readme.md diff --git a/Client-Side Components/Catalog Client Script/Multi-User Collaboration/Readme.md b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/Readme.md new file mode 100644 index 0000000000..e524d91907 --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/Readme.md @@ -0,0 +1 @@ +This project introduces a collaboration feature for Service Catalog requests, allowing multiple users to contribute to a single request. It’s ideal for scenarios like team onboarding, shared resource provisioning, or cross-functional workflows. From cdd271dcaf5f833c4bae01f1cbdcfc8cdab15b7c Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 20:18:43 +0530 Subject: [PATCH 2/5] Create client script.JS --- .../Multi-User Collaboration/client script.JS | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Multi-User Collaboration/client script.JS diff --git a/Client-Side Components/Catalog Client Script/Multi-User Collaboration/client script.JS b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/client script.JS new file mode 100644 index 0000000000..6365d4e9dc --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/client script.JS @@ -0,0 +1,13 @@ +function onSubmit() { + var collaborators = g_form.getValue('collaborators'); // Multi-user reference field + if (collaborators) { + var ga = new GlideAjax('CollaboratorHandler'); + ga.addParam('sysparm_name', 'addCollaborators'); + ga.addParam('sysparm_request_id', g_form.getUniqueValue()); + ga.addParam('sysparm_users', collaborators); + ga.getXMLAnswer(function(response) { + alert('Collaborators added: ' + response); + }); + } + return true; +} From 91bb46a4d780967283fa705117eb3036e44b4eb8 Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 20:20:36 +0530 Subject: [PATCH 3/5] Create Script include.JS --- .../Multi-User Collaboration/Script include.JS | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Multi-User Collaboration/Script include.JS diff --git a/Client-Side Components/Catalog Client Script/Multi-User Collaboration/Script include.JS b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/Script include.JS new file mode 100644 index 0000000000..637bce5fdf --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/Script include.JS @@ -0,0 +1,18 @@ +var CollaboratorHandler = Class.create(); +CollaboratorHandler.prototype = Object.extendsObject(AbstractAjaxProcessor, { + addCollaborators: function() { + var requestId = this.getParameter('sysparm_request_id'); + var users = this.getParameter('sysparm_users').split(','); + + users.forEach(function(userId) { + var gr = new GlideRecord('x_your_scope_collaborators'); + gr.initialize(); + gr.request = requestId; + gr.collaborator = userId; + gr.status = 'Pending'; + gr.insert(); + }); + + return 'Collaborators added successfully'; + } +}); From 476d4f13e754cd5c0a2a8dc08b64cdaec09d4384 Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 20:23:28 +0530 Subject: [PATCH 4/5] Create widget client controller.JS --- .../widget client controller.JS | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget client controller.JS diff --git a/Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget client controller.JS b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget client controller.JS new file mode 100644 index 0000000000..0273b282bd --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget client controller.JS @@ -0,0 +1,19 @@ +function($scope, $http) { + $scope.approve = function(sysId) { + $http.post('/api/x_your_scope/collab_action', { + action: 'approve', + sys_id: sysId + }).then(function(response) { + $scope.server.update(); + }); + }; + + $scope.reject = function(sysId) { + $http.post('/api/x_your_scope/collab_action', { + action: 'reject', + sys_id: sysId + }).then(function(response) { + $scope.server.update(); + }); + }; +} From 0cab7e3797bc915c9f659eb1dea358ce62106f2b Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 20:24:17 +0530 Subject: [PATCH 5/5] Create widget server script.JS --- .../widget server script.JS | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget server script.JS diff --git a/Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget server script.JS b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget server script.JS new file mode 100644 index 0000000000..7ca090d60e --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Multi-User Collaboration/widget server script.JS @@ -0,0 +1,15 @@ +(function() { + var collabs = []; + var gr = new GlideRecord('x_your_scope_collaborators'); + gr.addQuery('request', $sp.getParameter('request_id')); + gr.query(); + while (gr.next()) { + collabs.push({ + sys_id: gr.getUniqueValue(), + name: gr.collaborator.name.toString(), + status: gr.status.toString(), + comments: gr.comments.toString() + }); + } + data.collaborators = collabs; +})();