Set background color for Jira Announcement Banner

stuartu February 8, 2012

I have cloned our Jira Production environment, and want to place an announcement banner with a red background.

Can anyone advise the HTML text I would use to do this.

Thanks in advance.

4 answers

12 votes
Saul Perdomo January 21, 2015

This works for me in JIRA 6.2:

<!-- Message Banner -->
<div style="background-color: linen; border: 3px solid darkred; margin: 4px; padding: 2px; font-weight: bold; text-align: center;">
Maintenance Notification: This Jira environment will be offline today Wed Jan 21 from 12:15 to 12:30 EST for a memory upgrade.
</div>
nikhil khedlekar May 3, 2016

Saul - this is great .. works really well !

Like # people like this
Balvant Gmail July 4, 2016

Thanks works greatly

Silvia Goljerova January 20, 2019

I'm trying to add it in announcements without any luck?  Is there a step I'm missing?

Paul S March 3, 2021

Thank you for this, it worked perfectly! Greatly appreciated. 

4 votes
Dieter
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.
February 8, 2012

Place the following code in the announcement banner

<script>
(function($){
   $(document).ready(function(){
      $(".alertHeader").css("background-color","red");
   });  
})(AJS.$);
</script>

stuartu February 8, 2012

Brilliant! Thank you, that works.

JamieA
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.
February 8, 2012

Probably easier just to place the text in a <div style="..."> isn't it? Bit easier to understand and make changes.

Jobin Kuruvilla [Adaptavist]
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.
February 8, 2012

I do this:

<div class="global-warning" width="100%" align="center">Text</div>
Dieter
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.
February 9, 2012
Well depends, if one already does other DOM juggling in the ready handler that single line doesn't matter anymore ... If just used for the turning the banner red it's somehow oversized. nevertheless, i have discovered jquery for me and i love it :)
0 votes
Sagar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 28, 2021

If you want to refer the document in the announcement banner you can use the below one

<div style="font-weight: bold; text-align:center; color:green;">Yay! your jira is upgraded to 8.13.1, what's new? 
<a style="color:blue;"href="https://confluence.atlassian.com/jiracore/jira-8-13-long-term-support-release-change-log-1018788437.html">know more</a></div>
0 votes
Rishikesh Dugyala November 5, 2018

How can we update the banner with timeout?

something like below

<!-- Message Banner -->
<div style="background-color: linen; border: 3px solid darkred; margin: 4px; padding: 2px; font-weight: bold; text-align: center;">Testing</div>
<script>
(function($){
$(document).ready(function(){
$(".alertHeader").timeout:1000;
});
})(AJS.$);
</script>

Suggest an answer

Log in or Sign up to answer