-
Notifications
You must be signed in to change notification settings - Fork 913
UserManagement #1913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserManagement #1913
Conversation
|
|
||
| Overview | ||
| This Script Include returns users whose department is the same as the currently logged-in user’s department. | ||
| It can be used to filter the Caller field or any user reference field to show only users from the same department. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an example of what the reference qualifier will look like? This would make it easier for other users to use.
| getSameDeptUsers.prototype = { | ||
| initialize: function() {}, | ||
| getSameDept: function() { | ||
| var user = gs.getUser().getDepartmentID(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var user is not a good name for the Department. Perhaps userDepartment?
|
|
||
| var str = ""; | ||
| while (d.next()) { | ||
| str = str + "," + d.sys_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first value in the array will be empty. Perhaps you can use Array push? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push
| while (d.next()) { | ||
| str = str + "," + d.sys_id; | ||
| } | ||
| return 'sys_idIN' + str; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you then can include the array to string
|
Thank you for your submission, please see the review notes for the needed adjustments. Please note that your reference qualifier might result in unexpected behavior as for users also the Assignment group will determine which users show (as past of the group). |
PR Description:
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions