Customizing JIRA Look and Feel


Intro

This is going to be a quick one.

At my job, we have a couple JIRA environments that we use in addition to our production environment. We use these other JIRA installs to test upgrades/updates to JIRA and to install and demo major changes and plugins.

We keep the look and feel of our production environment pretty much stock, so we needed a way to differentiate between our production environment and our other various JIRA installs. I’ve written some scripts that allow us to refresh these testing environments easily, so that we have current, relevant data pulled from our producton JIRA. Because these test installs can be so similar to our production JIRA after running the scripts, we needed a way to ensure that we are always aware which environment we are in.

Luckily, the JIRA REST API allows us to modify the look and feel of JIRA. And if we can schedule these API calls, in crontab for example, we can ensure that the look and feel for all of our environments are consistent all the time.

The Solution

Here is a sample of the script we placed in the crontab of our test environments, scheduled to run every minute, that updates the UI/text colors, as well as the main site title:

#!/bin/sh
 
##TESTING ENVIRONMENT
 
##Change UI Colors
 
##Header Background Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#003b48"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.lf.top.bgcolour
##Header Highlight Background Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#708090"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.lf.top.hilightcolour
##Header Separator Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#ffffff"}' -H "Content-Type: application/json" https://jira-staging.trifecta.com/rest/api/2/application-properties/jira.lf.top.separator.bgcolor
##Header Text Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#ffffff"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.lf.top.textcolour
##Menu Item Highlight Background Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#708090"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.lf.menu.bgcolour
##Menu Item Highlight Text Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#ffffff"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.lf.menu.textcolour
##Button Background Color
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "#c0c0c0"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.lf.hero.button.base.bg.colour
##Set Title
/usr/bin/curl -k -D- -u ADMINUSER:ADMINPASSWORD -X PUT --data '{"value" : "TESTING ENVIRONMENT"}' -H "Content-Type: application/json" https://TESTING.DOMAIN.COM/rest/api/2/application-properties/jira.title