
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 08:21 AM
Hello everyone,
I am trying to create a UI Macro, which when clicked opens a window showing the list of Configuration Items assigned to the user in the Caller field. When clicking on the CI, this would then populate the CI field on the incident form. I wish to place the button next to the CI field itself (as the Caller field already has three buttons next to it).
I have gotten so far - I have the Macro button appearing where I want, and I have figured out that I need to use reflistOpenUrl and popOpenStandard functions. However I am struggling with creating the filter. I need the Macro to reference the caller field on the incident form, and then filter the CIs displayed in the pop-out window to only show those assigned to that caller - and this is where I am struggling.
If anyone could give me any pointers on how to do that, I'd be grateful. I am new to jelly and hardly a wizard in JavaScript (though I am learning fast!). I have found some older solutions but they are in some cases 8 or 9 years old and no longer seem to work in the same way.
Thanks in advance for any help.
Russ
Solved! Go to Solution.
- 4,508 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2017 10:06 AM
Thank you so much for your help Patrick. Using that info I now have the button working exactly how I need it! Here is the finished code for future searchers as what I posted before didn't construct the filter URL correctly, screenshot also provided below (clicking the CI in the popup window populates the CI field).
<?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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2023 11:03 AM
Hi Vikas, thank you so much for your response. I've tried doing this but it does not work. I believe it's because the target table of our Configuration Item field is set to Task table (as shown below)
Is there a way to get around this so that my UI Macro icon appears next to our CI field?