Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

« Forrige Version 3 Næste »

This is an extension of the Getting a field value in Read Mode - this will color the field after the value selected.

This css cant be in the banner, but must be "hidden" in a field, the type could be the "Message Custom Field (for view) from the JIRA Toolkit:

<script language=javascript>
var state=AJS.$("#customfield_11102-val").text().trim();
AJS.$("#customfield_11102-val").css("color", "black");
AJS.$("#customfield_11102-val").css("font-weight", "bold");
if (state == 'RED')
{
AJS.$("#customfield_11102-val").css("background-color","#ff0000");
}
if (state == 'AMBER')
{
AJS.$("#customfield_11102-val").css("background-color","gold");
}
if (state == 'GREEN')
{
AJS.$("#customfield_11102-val").css("background-color","#00ff00");
}
if (state == 'WHITE')
{
AJS.$("#customfield_11102-val").css("background-color","white");
}
</script>

Or better, using the AUG for lozenge's:

<script language=javascript>
var state=AJS.$("#customfield_10621-val").text().trim();
AJS.$("#customfield_10621-val").addClass("jira-issue-status-lozenge");
AJS.$("#customfield_10621-val").addClass("aui-lozenge");
if (state.indexOf('RED') >= 0)
{
AJS.$("#customfield_10621-val").addClass("jira-issue-status-lozenge-blue-gray");
}
if (state.indexOf('YELLOW') >= 0)
{
AJS.$("#customfield_10621-val").addClass("jira-issue-status-lozenge-yellow");
}
if (state.indexOf('GREEN') >= 0)
{
AJS.$("#customfield_10621-val").addClass("jira-issue-status-lozenge-green");
}
</script>
  • Ingen etiketter