Agile board - color in Theme like in epics

DreDay3000
Giga Guru

On the agile board in Backlog or sprint planning, stories related to an epic show the color of the epic.

We would like to be able to set color in story themes too, but it's not enough to just create a "Color" reference to color definition attribute.

 

How can we configure the page to show the color of the themes as well as that of the epics?

 

DreDay3000_0-1738608734065.png

 

7 REPLIES 7

I have applied the below script but getting the same results:

DreDay3000_0-1738701933495.png

(function executeRule(current, gForm, gSNC) {
    // Ensure the script only runs for the 'agile_board.do' table
    if (current.getTableName() === 'agile_board.do') {
        var epicColor = current.epic.color;  // Get Epic color
        var themeColor = current.theme.color; // Get Theme color
      
        // // Check if themeColor is available and apply it
        // if (themeColor) {
        //     gForm.setStyle('theme', 'background-color:' + themeColor + ' !important');
        // }
        // If themeColor is not available but epicColor is, apply epicColor
        if (epicColor) {
            gForm.setStyle('theme', 'background-color:' + epicColor + ' !important');
        }
        // If neither color is available, apply a default color (blue)
        else {
            gForm.setStyle('theme', 'background-color:' + '#00008b' + ' !important');
        }
    }
})(current, gForm, gSNC);
 
DreDay3000_2-1738702017662.png

 

could you help me with this UI Script

DreDay3000_0-1738775418167.png

 

 

Verify the Correct Field Name

  • Check if current.theme.color and current.epic.color correctly reference the color field in the database.
  • Use gs.info(current.theme.color); in a server-side script to verify if the color values are being retrieved correctly.

Apply the Style Correctly

  • Instead of theme, apply the color to a DOM element that represents the theme in the Agile Board.
  • Try setting the style directly on the field ID.

Try this Sample Client Script (Type: onLoad) instead:

 

(function executeRule(gForm, gSNC) {
    var epicColor = gForm.getValue('epic');  // Get Epic reference
    var themeColor = gForm.getValue('theme'); // Get Theme reference

    // Ensure valid colors are set
    var finalColor = themeColor ? themeColor : (epicColor ? epicColor : "#00008b"); 

    // Apply background color using jQuery
    if (finalColor) {
        setTimeout(function() {
            $("input[name='theme']").css("background-color", finalColor);
        }, 500); // Adding delay to ensure DOM is loaded
    }
})(gForm, gSNC);

 

 


ɪꜰ ᴍʏ ᴀɴꜱᴡᴇʀ ʜᴀꜱ ʜᴇʟᴘᴇᴅ ᴡɪᴛʜ ʏᴏᴜʀ Qᴜᴇꜱᴛɪᴏɴ, ᴘʟᴇᴀꜱᴇ ᴍᴀʀᴋ ᴍʏ ᴀɴꜱᴡᴇʀ ᴀꜱ ᴛʜᴇ ᴀᴄᴄᴇᴘᴛᴇᴅ ꜱᴏʟᴜᴛɪᴏɴ ᴀɴᴅ ɢɪᴠᴇ ᴀ ᴛʜᴜᴍʙꜱ ᴜᴘ.




ʙᴇꜱᴛ ʀᴇɢᴀʀᴅꜱ


ꜱʀᴇᴇʀᴀᴍ