- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 09:27 AM - edited 06-18-2025 09:41 AM
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)
3. On the Incident form right-click the caller_id field and select 'Configure Dictionary'
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
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:
Hope that helps everyone avoid the confusion 🙂
Regards
Paul