How to add a CI (assigned To computer) to the user pop up view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 04:52 AM - edited 11-05-2024 06:55 AM
Hi,
When I am on an Incident form and press the information button next to the Caller field a pop up appears with the sys_user details. I would like to include information such as what computer has been assigned to this user.
Are we able to do this?
Thanks Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 04:56 AM
Hi @Ian46
This is called sys_pop up view. I am not sure you can do in same popup as computer is an asset and to get this you can add another symbol to see what asset tagged to user.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 06:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 06:28 AM
caller_id field refers to sys_user table and there is no OOB computer field on sys_user table.
So you cannot show the computer assigned to that user on sys_popup view.
To achieve your requirement do this
1) have a Computer reference field on sys_user and add that on sys_popup view
2) then have an after update/insert BR on cmdb_ci_computer table and search that user and update the Computer field with the current record sysId
Something like this
BR: After insert/update
Condition: current.assigned_to != ''
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var userRec = current.assigned_to.getRefRecord();
userRec.u_computer = current.getUniqueValue(); // give here the name of newly created computer field on user table
userRec.update();
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 06:57 AM