- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 01:37 PM
I'm looking for the best way to set the Configuration item in the Open IT Ticket 2.0 topic to the logged-in user's computer asset. I would like to use the alm_asset table and search for the assigned_to = vaInputs.user
Solved! Go to Solution.
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 11:22 PM
@bekfro Use the following script.
(function execute() {
var ci_item='';
var glideRecord = new GlideRecord('alm_asset');
glideRecord.addQuery('assigned_to',vaInputs.user);
glideRecord.query();
if(glideRecord.next()){
ci_item = glideRecord.getValue('ci');
}
return ci_item;
})()
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2023 11:22 PM
@bekfro Use the following script.
(function execute() {
var ci_item='';
var glideRecord = new GlideRecord('alm_asset');
glideRecord.addQuery('assigned_to',vaInputs.user);
glideRecord.query();
if(glideRecord.next()){
ci_item = glideRecord.getValue('ci');
}
return ci_item;
})()
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 05:45 AM
@Sandeep Rajput
Thank you! I was able to add an else statement to set a CI if the Computer is not assigned to the user.
Working great!