Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
8.2
-
None
-
Unknown
-
Description
Context
The documentation explains how to add a JIRA field displayer as a wiki component (a XWiki.ComponentClass xobject with a Groovy method body). The example on the old extensions.xwiki.org page called:
xcontext.method.defaultDisplayer.displayField(field, issue)
with two arguments, while JIRAFieldDisplayer.displayField takes three:
List<Block> displayField(JIRAField field, Element issue, JIRAMacroParameters parameters);
So the published example cannot have worked against any recent version. The new documentation page on xwiki.org corrects it by reading the third method input:
def parameters = xcontext.method.input.get(2)
String text = xcontext.method.defaultDisplayer.displayField(field, issue, parameters).get(0).getProtectedString()
What is missing
The corrected snippet was written from the interface signature - it has not been run on a live wiki. In particular the xcontext.method.input.get(2) binding and the number/order of inputs the wiki component receives are unverified.
What to do
- Run the corrected example on a real XWiki instance and fix the documentation page if the binding differs.
- Ideally add a functional test in jira-test/jira-test-docker that registers the wiki component and asserts the custom field rendering, so the example cannot silently rot again.
The documentation page is https://www.xwiki.org/xwiki/bin/view/documentation/extensions/dev/jira/add-field-displayer/