How do I get wiki rendered custom jira field to show correctly in Confluence JIRA Issues Macro

Al August 28, 2017

Confluence 6.1.2

Jira 7.3.3

I have created a custom field with Kepler scripted SIL to return either Acceptable or Unacceptable, each colored green or red depending on outcome. E.g. 

//Evaluation
number score=#{Initial Risk Evaluation Score};
string riskStatus;

if ((score >= 0 ) && (score < 8)) {
    riskStatus = "{color:green} Acceptable {color}";
}
else {
    riskStatus = "{color:red} Not Acceptable {color}";
}
return riskStatus;

 

I have set the field configuration to Wiki style renderer, and this shows ok in the Jira issue, and in jira issue search.

However, I also need these fields to be part of a table in Confluence using Jira Issues Macro. When I display this custom field in a table, I simply get the plain text, e.g. color:red} Not Acceptable {color}

Can you please help?

Thanks
Al

1 answer

1 accepted

0 votes
Answer accepted
Sebastien Jacques
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2017

@Al,

I'm not familiar with Kepler and not sure if this will work. If Kepler scripted SIL allows you to set the field to html, you can leverage the AUI Lozenge CSS class type to render the field like the JIRA status field.

Specifically:

  • For green, use: "<span class='status-macro aui-lozenge aui-lozenge-success'>Acceptable</span>"
  • For red, use: "<span class='status-macro aui-lozenge aui-lozenge-error'>Not Acceptable </span>"
Al August 28, 2017

Hi Sebastien,

Thanks very much for your answer. This lozenge approach would be ideal.

There appears to be others using this with SIL (see https://ecosystem.atlassian.net/browse/AUI-3264) which is great. However, for some reason it's not rendering in JIRA for me; the content of " " is simply showing as plain text. 

Do you know how else I can check this ?

 

Thanks for your time

Al

Al August 28, 2017

Further note:

Some progress in that the lozenges of the custom SIL field render ok now in Confluence jira issues table, but not in the JIRA itself. Not sure why this is, it's now the inverse problem - screenshots attached

 

Screen Shot 2017-08-28 at 23.47.57.pngScreen Shot 2017-08-28 at 23.49.03.pngScreen Shot 2017-08-28 at 23.49.21.png

Al September 10, 2017

With some initial pointer to using AUI Lozenges from Sebastien above. Lozenges are ideal, but there seems to be some limitation on which field types they can be applied to. With other queries in the community a suitable script can be used to set the valueI came up with a workaround to display in both JIRA and Confluence.

Described here

Note, I have chosen the method in my workaround simply to ensure backward compatibility across multiple projects and linked confluence documents setup using the jira issues macro.

Suggest an answer

Log in or Sign up to answer