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

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

This widget could not be displayed.

@Al Christie,

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>"

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

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

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

146 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you