SwizzlePlugin
This plugin isn't bundled with any XWiki product by default.
Plugin developed by the XWiki Development Team.
This plugin can be downloaded.
Plugin developed by the XWiki Development Team.
This plugin can be downloaded.
Swizzle Plugin
A plugin that allows using Swizzle from a XWiki page. For example this allows to query a JIRA instance and display all sort of information in a XWiki page about it.Installation
Activate the plugin by editing your WEB-INF/xwiki.cfg file as follows and restart your XWiki instance:xwiki.plugins=[...],com.xpn.xwiki.plugin.swizzle.SwizzleJiraPlugin
Usage
To use the plugin in your wiki, you'll need to write some Velocity code to integrate it where you want to use it, as shown below. You can use any method from the Swizzle JIRA API.Examples
Display a list of issues based on a JIRA RSS URL
Example using XWiki 2.0 syntax:{{velocity}}
#macro (jira $pid $fixfor)
#set ($jirarss = $xwiki.swizzle.getJiraRss("http://jira.xwiki.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?&pid=${pid}&fixfor=${fixfor}&sorter/field=issuekey&sorter/order=DESC&tempMax=1000"))
|=Type|=Key|=Summary|=Status
#foreach ($issue in $jirarss.getIssues())
|$issue.getType()|[[$issue.getKey()>>$issue.getLink()]]|$issue.getSummary()|$issue.status.name
#end
#end
#jira("10010" "10435")
{{/velocity}}Result
Displays a list of JIRA issues based on a JQL Query
{{velocity}}
#macro (jira $jqlQuery)
#set ($jirarss = $xwiki.swizzle.getJiraRss("http://jira.xwiki.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=$escapetool.url($jqlQuery)"))
|=Type|=Key|=Summary|=Status
#foreach ($issue in $jirarss.getIssues())
|$issue.getType()|[[$issue.getKey()>>$issue.getLink()]]|$issue.getSummary()|$issue.status.name
#end
#end
#jira("project='XWiki' AND fixVersion='2.4 RC1'")
{{/velocity}}Displays a list of JIRA projects
#set ($jira = $xwiki.swizzle.getJira("http://jira.xwiki.org/jira/rpc/xmlrpc")) $jira.login("username", "password") {table} ID | Key | Project Name | Project Lead | Project URL #foreach ($project in $jira.getProjects()) $project.getId() | $project.getKey() | $project.getName() | $project.getLead() | $project.getProjectUrl() #end {table}
Result
Tips
Sorting
You can sort using:- sort("fieldname")
- ascending("fieldname")
- descending("fieldname")
#foreach ($issue in $jirarss.issues.descending("created"))