Paul Curwen
Giga Sage

So many missteps and errors on this post.

 

If you are having issues follow these simple steps:

 

1. Create a UI Macro 

 

Set Name field to: match_cis

 

In the XML field paste the following code: 

 

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

     <j2:set var="jvar_n" value="getUserAssets_${ref}"/>

     <a id="${jvar_n}" onClick="getUserAssets()" title="Lookup user assets" alt="Add me" tabindex="0" class="btn btn-default icon-hardware"></a>

     <script>

 

      function getUserAssets() { 

 

       var refurl = reflistOpenUrl('incident.cmdb_ci', 'incident.cmdb_ci', 'cmdb_ci', 'cmdb_ci', 'null', 'false', '');  

       var url = 'assigned_to=' + g_form.getValue('caller_id');      

             var refurlquery = refurl + url;          

             popupOpenStandard(refurlquery, 'lookup');

 

             }

     </script>

 

</j:jelly>

 

Save the form. It will look something like below (not all code shown in image) 

 

match cis.PNG

 

3. On the Incident form right-click the caller_id field and select 'Configure Dictionary'

 

select.PNG

 

4. In the Attibutes field paste the following

 

encode_utf8=false,ref_contributions= match_cis

 

Important ote: if you already have ref_contribution in the Attributes field simple type ; at the end of what is already there and and add match_cis

 

dict.PNG

 

5. Test on incident form by populating Caller ID field with a user that has config items and you should see the new field decorator as below, click it and select any CI it will then populate the selected CI on the cmdb-ci field: 

 

uimacro.PNG

 

Hope that helps everyone avoid the confusion 🙂

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul