- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 06:35 AM
Hi Team
i have created a catalog item(Dev_Req) & i have created Requested for lable(Username)
while the item requested, it will automatically trigger to concern users manager .. i have created a approval action in work flow but it is skipped automatically and directly going to the sc_task .. will you pls guide me
Regards
khasim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 08:21 AM
Hello,
To request approval from Requested for's manager; you need to do below changes in the approval activity:
answer = [];
var manager1 = current.variables.user_name.manager;
answer.push(manager1);
Please mark my answer correct if you find it helpful.
Thanks,
Kavita Bhojane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 06:55 AM
Hi @shaikkhasim ,
Can you try changing the type of username field to reference n then try again please. I believe it should work. I am not exactly sure as to wht output does requested for type field provides.
Mark my answer helpful & accepted if it helps you resolve your query.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 08:21 AM
Hello,
To request approval from Requested for's manager; you need to do below changes in the approval activity:
answer = [];
var manager1 = current.variables.user_name.manager;
answer.push(manager1);
Please mark my answer correct if you find it helpful.
Thanks,
Kavita Bhojane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 09:08 AM
Hi Kavitha
Thanks for your suggestions, it is working
Regards
khasim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 08:22 AM
Hi @shaikkhasim
In approval activity , you need to glide record on "sys_user" table to get User's manager and then push it to answer array.
answer=[];
var user = current.variables.user_name;
var grUser= new GlideRecord('sys_user');
grUser.addQuery('sys_id' , user);
grUser.query();
if ( grUser.next() ) {
answer.push(grUser.getValue('manager') );
}
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates