- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 11:33 AM
I have a requirement to pull the caller's assets as a list and also have the ability to be able to search all assets in case the caller is reporting an issue with an asset not assigned to him. i created a script include to pull the assets for the user but how do i call it to display as a list and also have a search next to it .Initially i created the field as a reference where i can search but if i want to display as list i changed it to list type. Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 03:58 PM
Hi Sam,
Here would be my approach to this. Use a UI macro that displays the callers assets. And then leave the configuration item field as is.
This way you can easily find the users assets and put that in the config item field without having to lock it down via reference qualifier. Like you said what if they call about an asset that's not assigned to them.
If you need more info about the UI macro look for user_related_incidents I believe. Use that as a reference, create a new UI macro and just modify that to the cmdb_ci table.
Hope that helps!
Mike Bahr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 03:58 PM
Hi Sam,
Here would be my approach to this. Use a UI macro that displays the callers assets. And then leave the configuration item field as is.
This way you can easily find the users assets and put that in the config item field without having to lock it down via reference qualifier. Like you said what if they call about an asset that's not assigned to them.
If you need more info about the UI macro look for user_related_incidents I believe. Use that as a reference, create a new UI macro and just modify that to the cmdb_ci table.
Hope that helps!
Mike Bahr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2015 09:38 AM
Thank you MIke, I tried this but doesnt seem to be working. In the attributes for Asset field (I have Asset reference to Assets table.) I have
ref_contributions=user_show_assets,ref_auto_completer=AJAXTableCompleter,ref_ac_columns=name;,ref_ac_columns_search=false
UI_macro
<?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:evaluate var="jvar_guid" expression="Packages.com.glide.util.Guid.generate(this);" />
<j:set var="jvar_n" value="show_cis_${jvar_guid}:${ref}"/>
<g:reference_decoration id="${jvar_n}"
field="${ref}"
onclick="showRelatedCIList('${ref}');"
title="${gs.getMessage('Show related Assets')}"
image="images/icons/cmbd_ci.gifx"/>
<script>
// show related list
function showRelatedCIList(reference) {
var s = reference.split('.');
var referenceField = s[1];
var v = g_form.getValue(referenceField);
// var url = 'cmdb_ci_list.do?&amp;sysparm_query=assigned_to=' + v;
var url = tableName + '_list.do?';
url += 'sysparm_query=assigned_to=' + v;
var w = getTopWindow();
w.popupOpenFocus(url, 'related_list', 950, 700, '', false, false);
}
</script>
</j:jelly>
what am i doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2015 12:52 PM
Hi Sam,
Place the attribute on the caller_id / requested_for / "Your user field" instead. That's what it uses to find the assigned to assets.
Let me know if you are still having trouble.
Thanks!
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2015 12:53 PM
Also, just noticed that you have a spelling error.
image="images/icons/cmbd_ci.gifx"/>
cmdb_ci.gifx