This issue has been created
 
 
JIRA Components / cid:jira-generated-image-avatar-a2994298-434a-482e-925c-fc6f1b3bef96 JIRA-121 Open

Verify the documented wiki component JIRA field displayer example on a live wiki

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-2f079a6b-855d-4d64-b23e-dd06ebe50bd7 Vincent Massol created this issue on 27/Jul/26 22:27
 
Summary: Verify the documented wiki component JIRA field displayer example on a live wiki
Issue Type: cid:jira-generated-image-avatar-a2994298-434a-482e-925c-fc6f1b3bef96 Task
Affects Versions: 8.2
Assignee: Unassigned
Components: JIRA Macro
Created: 27/Jul/26 22:27
Priority: cid:jira-generated-image-static-major-b16ae6b7-6ff6-4a17-a6b1-90c528181085 Major
Reporter: Vincent Massol
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/