Color for issues in gadgets (e.g filter results) based on custom field value

Peter Jahn November 9, 2014

I would like to show issues with different background colors in filter result gadgets based on a custom field value. Example: Field "Escalated by customer" = yes => red background color for the issue. 

Is there a way to do that?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Midori
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2014

You may want to try these plugins (I don't have first-hand experience with any of these):

  1. Resolution and Status Colors does this, but does not seem to support custom fields. Even so, you may want to contact the author and ask for this feature, as that would perfectly fit the plugin's value proposition.
  2. https://marketplace.atlassian.com/plugins/org.hakanai.jira.plugins.jirastatuscolor also does this, but only for status. Same as previous.
  3. Color Custom Field could possibly solve it, too. Although it does not color the whole line, only a rectangle, it may be an acceptable workaround.

+ And you still have the option to implement this as a simple scripted field using the Script Runner plugin.

 

Adolfo Casari
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 17, 2014

I created a scripted field but the filter result gadget doesn't diplay the HTML. It display OK in the issue screen though. Here is the code: import com.atlassian.core.util.DateUtils import com.atlassian.jira.ComponentManager import com.atlassian.jira.issue.fields.CustomField enableCache = {-> false} customField = componentManager.getCustomFieldManager().getCustomFieldObjectByName("Termino Plan Etapa Actual") Termino_Plan_Etapa_Actual = issue.getCustomFieldValue(customField) customField = componentManager.getCustomFieldManager().getCustomFieldObjectByName("Termino Real Etapa Actual") Termino_Real_Etapa_Actual = issue.getCustomFieldValue(customField) if (Termino_Plan_Etapa_Actual && !Termino_Real_Etapa_Actual) { Double timeDiff = Termino_Plan_Etapa_Actual.getTime() - System.currentTimeMillis() Double a = (timeDiff / (1000*60*60*24)) Integer dias = (int)(a.trunc() + 1) if (dias <= 0) { return "<div class='aui-lozenge aui-lozenge-error'>" + dias.toString() + " d </div>" } else { return "<div class='aui-lozenge aui-lozenge-success'>" + dias.toString() + " d </div>" } } return null

Belinda Randolph May 18, 2016

I am very interested in learning more about your "scripted field", but I am a newbie to Confluence 5.  Where does the "scripted field" go? I would like to learn more.  Thank you!

 

TAGS
AUG Leaders

Atlassian Community Events