kb affected products

coolboy
Mega Expert

Hi all,
we have a macro named kb_affected_products in Service now.What this macro does is it makes a List of products to which a Knowledge article pertains. Now as per my requirement i want when name of CI attached to particular knowledge article is list user should be able to click that ci link and go to particular ci.

Current 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">

<!-- list of products to which this article pertains -->

<j:set var="jvar_kb_show_products" value="${gs.getProperty('glide.knowman.affected_products.display','true')}"/>
<j:if test="${jvar_kb_show_products}">
<g2:evaluate var="cis" jelly="true" expression="
var cis = new GlideRecord('m2m_kb_ci');
cis.addQuery('kb_knowledge','$[kb.sys_id]');
cis.orderBy('cmdb_ci.name');
cis.query();
"/>
<j2:if test="$[cis.hasNext()]">
<tr>
<td width="99%" class="label label_spacing" style="background-color:#eeeeee;">
<span style="margin-right:3px; margin-left:1px;">$[SP]</span>Affected products:</td>
<td>
<j2:while test="$[cis.next()]">
<div>
<img src="images/icons/kb_ci.gifx" alt="$[HTML:cis.cmdb_ci.name]" />$[HTML:cis.cmdb_ci.name] </div>
</j2:while>
</td>
</tr>
</j2:if>
</j:if>
</j:jelly>

Thanks
4 REPLIES 4

wallymarx
ServiceNow Employee
ServiceNow Employee

Hi--

I asked around on this and the general consensus seems to be that this goes into enhancement request territory.

Cheers,
Wally


thanks guys !!!


CapaJC
ServiceNow Employee
ServiceNow Employee

If you really want to customize (and thus own, so you don't get future updates to) that UI Macro, you could replace the div with the following:



<div>
<img src="images/icons/kb_ci.gifx" alt="$[HTML:cis.cmdb_ci.name]" />
<j2:if test="$[cis.cmdb_ci.canReadRef()]">
<a href="$[HTML:cis.cmdb_ci.sys_class_name].do?sys_id=$[cis.cmdb_ci]">$[HTML:cis.cmdb_ci.name]</a>
</j2:if>
<j2:if test="$[!cis.cmdb_ci.canReadRef()]">
$[HTML:cis.cmdb_ci.name]
</j2:if>
</div>


CapaJC
ServiceNow Employee
ServiceNow Employee

By the way, I just checked this in as an enhancement for the next Release. If you can wait, you'll get it for free without having to customize/own that UI Macro.

It was a good idea. Thanks!

--J