UI Macro to display CIs assigned to a user

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
 

Assets currently assigned to this user:
<a href='' onclick="event.preventDefault();showdiag();">click here</a>

<script>
 
function showdiag(){
  var req_for=g_form.getValue('var_requested_for');
  if (req_for!=''){
var dialog = new GlideDialogWindow('show_list');
dialog.setTitle('Assets assigned to user');
dialog.setPreference('table', 'cmdb_ci_list');
dialog.setPreference('sysparm_view', 'default');
var query = 'assigned_to=' + req_for;
dialog.setPreference('sysparm_query', query);
        dialog.render();
  }
}

Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue