Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1220

Custom JIRAfielddisplayer for JIRA Macro doesn't work for "status" field

$
0
0

Hi,

I tried to change the fielddisplayer for the field “status”, so that it shows me the status as text instead of an Icon.

For this I tried out the example in the “Jira Macro” desription, to add a new fielddisplayer by xwiki components.

{{groovy}}
import org.xwiki.rendering.block.*
import org.xwiki.rendering.listener.reference.*

def field = xcontext.method.input.get(0)
def issue = xcontext.method.input.get(1)
def parameters = xcontext.method.input.get(2)
String text = xcontext.method.defaultDisplayer.displayField(field, issue,parameters).get(0).getProtectedString()

def reference = new ResourceReference(text, ResourceType.URL)
def labelBlocks = [new WordBlock("Lien")]
xcontext.method.output.value = [new LinkBlock(labelBlocks, reference, true)]
{{/groovy}}

For the field “summary” it works perfectly, but “status” seems to ignore it.

{{jira fields="status!lien,summary!lien,status!lien" id="6753" source="jql"}}
fixVersion = "Januar- Version 2025"  AND type = Bug
{{/jira}}

Dows anyone has an idea how I can change the status too, so it shows the text instead of a Icon?

I am completly new to groovy, so sorry if I am missing some obvious things.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1220

Trending Articles