Hi,
As part of migrating bugs from JIRA to BugZilla, below is the requirement:
If there are multiple “version” tags in my input.xml file
For open bugs (Resolved,Reopened,Inprogress,NeedInfo) > create multiple bugs, one for each “version". “Fix version” will be empty.
For closed bugs > create multiple bugs, one for each “Fixed in” version. Use earliest “version" for all bugs.
I tried using the apply-template in the XSLT for the above requirement as shown below:
XSLT Code:
<xsl:if test="status = 'Open'">
<xsl:for-each select="/rss/channel/item/version">
<xsl:apply-templates select="/rss/channel/item">
<!--<xsl:with-param name="itemDetails" select="."/>-->
</xsl:apply-templates>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</bugzilla>
</xsl:template>
<xsl:template match="item">
<!--<xsl:param name="itemDetails"/>-->
<bug>
<version>
<xsl:value-of select="version" />
</version>
</bug>
</xsl:template>
</xsl:stylesheet>
XML Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by JIRA 91 at Mon Sep 15 06:28:30 EDT 2008 -->
<rss version="0.92">
<channel>
<title>Sentinel Issue Tracking System</title>
<link>http://bugs.esecurity.net:8090</link>
<description>This file is an XML representation of an issue</description>
<language>en</language>
<item>
<title>[SEN-8448] CIDR-enabled dynamic lists</title>
<link>http://bugs.esecurity.net:8090/browse/SEN-8448</link>
<description><![CDATA[L-3 (Partner) requested to store in the dynamic list, a representation of a range of IP addresses against which we could correlate events. Given an entry of say, '192.168.0.0/24', we'd like to be able to ascertain whether or not a source or destination IP address falls in the range.
<br>
The inlist operator (Reference Guide, Chapter 6, Sentinel Correlation Engine RuleLG Language, page 6-3) would be wonderful, if we could extend to it some functionality - that is, if we could store an IP address range in CIDR notation, then use the 'match regex' or 'match subnet' operators to match a list item against an IP address present in an incoming event.
<br>
<br>
]]></description>
<environment><![CDATA[]]></environment>
<key id="87113">SEN-8448</key>
<summary>CIDR-enabled dynamic lists</summary>
<type id="4">Enhancement</type>
<priority id="5">Trivial</priority>
<status id="1">Open</status>
<resolution>Unresolved</resolution>
<assignee username="pattabiraman.srinivasan">Pattabiraman Srinivasan</assignee>
<reporter username="peng.liu">Peng Liu</reporter>
<created>Fri, 11 Jul 2008 14:07:41 -0400 (EDT)</created>
<updated>Fri, 11 Jul 2008 14:07:41 -0400 (EDT)</updated>
<version>6.1.0.17</version>
<version>6.0.0.0_SP2_Hotfix4</version>
<component>Correlation</component>
<component>Dynamic Lists</component>
<due></due>
<votes></votes>
<customfields>
</customfields>
</item>
</channel>
</rss>
With the above XSLT, i am getting two <bug></bug> tags with the same version ie, 6.1.0.17 instead of getting each with one version of input xml file.
Any help in this regard is highly appreciated.
Thanks,
Saritha