Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Announcement Banner unexpected behavior outside of system pages

Josh
Contributor
October 16, 2023

I have the following

<script>
AJS.toInit(function(){
var $banner = AJS.$('#announcement-banner');
var $header = AJS.$('#header');

$header.before($banner);
});
</script>

 
This should place the announcement banner above the header.  However, it only seems to work on the system pages.  In the past, I think it worked on every page, so I don't know if there is some sort of plugin affecting this, or if it is a change in Jira itself. 

If I wrap the function in a timeout, then it will work.  I've tried waiting until the header element appears, but it seems to be something else loading that is making the header override this.  If I were to run this directly in the console then it would work to move the elements.

Jira Data Center 9.6.


1 answer

0 votes
Josh
Contributor
October 16, 2023

Found solution that works overall (it sometimes has a half second delay, so that would be nice to be rid of, but it will place the banner above the header):

<script type="module" defer>

AJS.toInit(function(){
var $banner = AJS.$('#announcement-banner');
var $header = AJS.$('#header');

$header.before($banner);
});
</script>

from: https://community.atlassian.com/t5/Jira-questions/Announcement-banner-script-not-working-after-Jira-upgrade-to-9-4/qaq-p/2231991

Suggest an answer

Log in or Sign up to answer