I've created a script that looks like this:
String customField = getCustomFieldValue("custom field")
Double index = Double.parseDouble(customField)
if (index <= 1) {
return "<div style='color:green;'><b>Low</b></div>"
}
else if (index > 1 && index < 2) {
return "<div style='color:green;'><b>Normal</b></div>"
}
else if (index >= 2 && index < 4) {
return "<div style='color:#FFBF00;'><b>High</b></div>"
}
else if (index > 4) {
return "<div style='color:red;'><b>MAX</b></div>"
}
else {
return "<div style='color:red;'><b>ERROR</b></div>"
}This script works great and exactly as I've intended. The correct formatting displays when I show the column on a View screen, in a column in the Issue Navigator, in an exported Excel file, and in a column within a gadget.
However, I'd like to be able to use the values in this field as the basis for a gadget, such as the basis for an Issue Statistics gadget. However, when doing this, the value in the gadget isn't returned as the formatted text (for example, green bolded "Low"), but appears as a string of HTML code. Is there a way to only return the text without the full HTML code when basing a gadget on this field?
Thank you in advance for your help here!