Skip to content
Closed
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,12 @@
**Script explanation :**
When called via GlideAjax from a client script, it:

1) Takes the user’s sys_id as a parameter (sysparm_user_sys_id).
2) Queries the sys_user table for that record.
3) Extracts:
The user’s direct manager (manager1)
The manager’s manager (manager2)
4) Returns the results as a JSON string.

**Usage of this script :**
When the user wants to escalate they can utilize the manager or manager's sys_id depending upon their requirement.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var ManagerInfo = Class.create();
ManagerInfo.prototype = Object.extendsObject(AbstractAjaxProcessor, {

getManagerInfo: function(){
var usr=this.getParameter("sysparm_user_sys_id"); //getting the logged in user's sysid from the client script
var obj={}; //JSON object
var gr= new GlideRecord("sys_user"); //gliding over user table
gr.addQuery("sys_id",usr);
gr.query();
if(gr.next()){
obj.managr1=gr.manager.toString(); //getting immediate manager's sys_id and storing in json object
obj.managr2=gr.manager.manager.toString(); //getting skip level manager's sysid and storing in json object
}

return JSON.stringify(obj); //returning the object to client script for further usage
},
type: 'ManagerInfo'
});
Loading