The fix is:
The upgrade of JIRA should keep the changes to resolve the following problem by applying the fix below
Problem
When reporting JIRA issues through Confluence, the Confluence macro "JIRA Macro / Search" does not show the values of the standard fields that have multiple values, namely fixVersions, versions, components
The reason is that the XSLT at Confluence side does expect 0 or 1 XML element named after the standard field, instead of several.
Fix
Instead of generating several XML elements, generate 1 XML element with several values in it:
- Open ${atlassian-home}/atlassian-jira/WEB-INF/classes/templates/plugins/issueviews directory
- Copy the file single-xml.vm as single-xml.org.vm (for backup)
- Edit the file single-xml.vm
- Find the fragment
#if ($issue.affectedVersions && ($issueXmlViewFields.isFieldRequestedAndVisible('versions')))
#foreach ($version in $issue.affectedVersions)
<version>#xmlEscape($version.name)</version>
#end
#end
#if ($issue.fixVersions && ($issueXmlViewFields.isFieldRequestedAndVisible('fixVersions')))
#foreach ($version in $issue.fixVersions)
<fixVersion>#xmlEscape($version.name)</fixVersion>
#end
#end
#if ($issue.components && ($issueXmlViewFields.isFieldRequestedAndVisible('components')))
#foreach ($component in $issue.components)
<component>#xmlEscape($component.name)</component>
#end
#end |
- Replace it with
#if ($issue.affectedVersions && ($issueXmlViewFields.isFieldRequestedAndVisible('versions')))
<version>
#foreach ($version in $issue.affectedVersions)#if ($issue.affectedVersions.indexOf($version)>0), #end #xmlEscape($version.name)#end
</version>
#end
#if ($issue.fixVersions && ($issueXmlViewFields.isFieldRequestedAndVisible('fixVersions')))
<fixVersion>
#foreach ($version in $issue.fixVersions)#if ($issue.fixVersions.indexOf($version)>0), #end #xmlEscape($version.name)#end
</fixVersion>
#end
#if ($issue.components && ($issueXmlViewFields.isFieldRequestedAndVisible('components')))
<component>
#foreach ($component in $issue.components)#if ($issue.components.indexOf($component)>0), #end #xmlEscape($component.name)#end
</component>
#end |
Please note that on JIRA upgrade this fix will be overwritten, so take care to apply the fix again.
The fix is:
The upgrade of JIRA should keep the changes to resolve the following problem by applying the fix below
Problem
When reporting JIRA issues through Confluence, the Confluence macro "JIRA Macro / Search" does not show the values of the standard fields that have multiple values, namely fixVersions, versions, components
The reason is that the XSLT at Confluence side does expect 0 or 1 XML element named after the standard field, instead of several.
Fix
Instead of generating several XML elements, generate 1 XML element with several values in it:
#foreach ($version in $issue.affectedVersions)
<version>#xmlEscape($version.name)</version>
#end
#end
#if ($issue.fixVersions && ($issueXmlViewFields.isFieldRequestedAndVisible('fixVersions')))
#foreach ($version in $issue.fixVersions)
<fixVersion>#xmlEscape($version.name)</fixVersion>
#end
#end
#if ($issue.components && ($issueXmlViewFields.isFieldRequestedAndVisible('components')))
#foreach ($component in $issue.components)
<component>#xmlEscape($component.name)</component>
#end
#end
<version>
#foreach ($version in $issue.affectedVersions)#if ($issue.affectedVersions.indexOf($version)>0), #end #xmlEscape($version.name)#end
</version>
#end
#if ($issue.fixVersions && ($issueXmlViewFields.isFieldRequestedAndVisible('fixVersions')))
<fixVersion>
#foreach ($version in $issue.fixVersions)#if ($issue.fixVersions.indexOf($version)>0), #end #xmlEscape($version.name)#end
</fixVersion>
#end
#if ($issue.components && ($issueXmlViewFields.isFieldRequestedAndVisible('components')))
<component>
#foreach ($component in $issue.components)#if ($issue.components.indexOf($component)>0), #end #xmlEscape($component.name)#end
</component>
#end
Please note that on JIRA upgrade this fix will be overwritten, so take care to apply the fix again.