Skip to content

Commit 91bb46a

Browse files
authored
Create Script include.JS
1 parent cdd271d commit 91bb46a

File tree

1 file changed

+18
-0
lines changed
  • Client-Side Components/Catalog Client Script/Multi-User Collaboration

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var CollaboratorHandler = Class.create();
2+
CollaboratorHandler.prototype = Object.extendsObject(AbstractAjaxProcessor, {
3+
addCollaborators: function() {
4+
var requestId = this.getParameter('sysparm_request_id');
5+
var users = this.getParameter('sysparm_users').split(',');
6+
7+
users.forEach(function(userId) {
8+
var gr = new GlideRecord('x_your_scope_collaborators');
9+
gr.initialize();
10+
gr.request = requestId;
11+
gr.collaborator = userId;
12+
gr.status = 'Pending';
13+
gr.insert();
14+
});
15+
16+
return 'Collaborators added successfully';
17+
}
18+
});

0 commit comments

Comments
 (0)