Software asset management: copy allocations

JuliaHowells
Tera Expert

On Software Entitlements, I want to add a UI Action that copies over the existing allocated users to a different piece of software. Functionally, the UI Action opens a modal, the user would select the users (either all or a subset) to be moved, and then also select the new software item that they should be copied over to. 

 

JuliaHowells_0-1715641100497.png

// UI Action

function doTransfer() {
    var confirm = new GlideModal('transfer_entitlement');
    confirm.setTitle('Transfer User Allocations');
    confirm.setPreference("onPromptComplete", "ok");
    confirm.setPreference("onPromptCancel", "cancel");
    confirm.render();
}

//Code that runs without 'onclick'

if (typeof window == 'undefined')
    updateEntitlement();

 function updateEntitlement() {
    action.setRedirectURL('alm_license.do?software_model=' + current.software_model);
 }
// UI Modal HTML

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
	<!-- g:macro_invoke id="user" name="user" macro= "lightweight_glide_list" control_name="user" reference="sys_user" can_write="true"/ -->
    <j:set var="jvar_list_data" value="55e0225e1b31b1105f7d2020f54bcbb7" />
	<j:set var="jvar_reference" value="alm_entitlement_user" />
    <j:set var="jvar_can_write" value="true" />
    <j:set var="jvar_ref_qual_elements" value="QUERY:licensed_by.sys_id=0ebd6a241b4ab1106064102eac4bcb78" />
    <j:set var="jvar_control_name" value="licensed_by" />
    <j:set var="jvar_control_id" value="licensed_by" />
    <j:set var="jvar_not_focused" value="true" />
    <g:lightweight_glide_list />
    <g:dialog_buttons_ok_cancel cancel="return onCancel();" ok="return onSubmit();"/>

</j:jelly>
//client script

 function createRecord(val) {
     if (!val) {
		alert('Please select a value.');
     } else if (val == 'newrecord') {
         gsftSubmit(null, g_form.getFormElement(), 'transfer');

     } else {
			alert('existing');
     }
 }

 

Right now the modal opens, but it shows ALL the users (not just the ones assigned to the current software) when I use the magnifying glass, and it shows the sys id of the user initially.

 

JuliaHowells_1-1715641401065.png

Any ideas on how to:

1. Only show the current list of user allocations 

2. Not have the sys id show, but the user's name instead

 

Thanks! 

0 REPLIES 0