Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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';
}
});
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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();
});
};
}
Original file line number Diff line number Diff line change
@@ -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;
})();
Loading