How do I populate current logged in user as Assigned To?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:38 PM
I want to auto populate current logged in user as Assigned To and current logged in user's Primary assignment Group as Assignment Group on Case form. Now I have created Display BR and getting current userID and passing it onLoad Client Script through scratchpad variable. but it is not working in workspace. I have made Client Script UI Type for "All". I want know alternative ways for this use case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:47 PM
Hi,
Use g_user API to get loggedin user deatils in UI Policy/Client script.
https://www.servicenow.com/community/developer-articles/glideajax-example-cheat-sheet/ta-p/2312430
If you need additional data then make GlideAjax call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:49 PM
@Sid_Takali ,
Can you please try in the client script only - g_user.userID
g_user is the client side API, you don't need to go for the display BR.
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:59 PM
Hi @Sid_Takali
you can use: javascript:gs.getUserID(); ------- This will give you the current logged in user.
Mark my answer helpful and correct if it helps to resolve your issue.
Thank you
Rajesh.