- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 09:53 AM - edited 01-24-2024 10:44 AM
I have a requirement to Create an Incident when a user is Added to a Group.
So when Group A has a User added to its membership an incident is created with the following information:
User Added == Caller ID, Affected User
Short Description: {User Added.name} added to Group A
Description: {User Added.name} to Group A, {User Added.title}
I was able to get a notification sent out when this happens. I can create an incident, but I'm having trouble populating the added information user (like their name, title, department etc.)
var Inc= new GlideRecord("incident");
Inc.initialize();
Inc.short_description = "Access Request - GroupA - " + current.variables.user.name; //current.variables.user.name does not work
Inc.assignment_group = '12341234'; //GroupAACCESS
Inc.category = 'software';
Inc.u_affected_software = 'GroupA';
Inc.u_subcategory_software = 'access_GroupA';
Inc.state = '1';
Inc.caller_id = current.variables.user.name; //current.variables.user.name does not work
Inc.u_affected_user = current.variables.user.name; //current.variables.user.name does not work
Inc.description =
"Please provide appropriate access for, " + '\n' +
"Requested for: " + current.variables.user.name + '\n'+
"Department: " + '\n'+
"Title: "+ '\n'+'\n'+
Inc.insert();
gs.addInfoMessage(gs.getMessage('record inserted:'+current.number));
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 10:20 AM
The solution can be found here:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 09:59 AM
Can you share your script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:34 AM
var Inc= new GlideRecord("incident");
Inc.initialize();
Inc.short_description = "Access Request - GroupA - " + current.variables.user.name; //current.variables.user.name does not work
Inc.assignment_group = '12341234'; //GroupAACCESS
Inc.category = 'software';
Inc.u_affected_software = 'GroupA';
Inc.u_subcategory_software = 'access_GroupA';
Inc.state = '1';
Inc.caller_id = current.variables.user.name; //current.variables.user.name does not work
Inc.u_affected_user = current.variables.user.name; //current.variables.user.name does not work
Inc.description =
"Please provide appropriate access for, " + '\n' +
"Requested for: " + current.variables.user.name + '\n'+
"Department: " + '\n'+
"Title: "+ '\n'+'\n'+
Inc.insert();
gs.addInfoMessage(gs.getMessage('record inserted:'+current.number));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 10:20 AM