You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi! I have developed a custom announcement banner depending on page visited using an easy frontend coding (html+js+jquery). In my case, I wanted to advise users about login issues on login page. And once logged, advise them about programmed Jira reboot but only on dashboard pages.
This is how I coded announcement banner:
<script type="text/javascript">
(function($) {
.....
AJS.toInit(function(){
// init on load
.....
if (($('#login-form').length === 1) || ($('#loginform').length === 1)) {
$('#alert-ACME-ldap').fadeIn(2500);
} else if ($(location).attr('pathname').indexOf("Dashboard.jspa") !== -1) {
$('#alert-ACME-reboot').show();
}
});
.....
})(AJS.$);
</script>
<div id="alert-ACME-ldap" style="display: none;">
<div id="aui-flag-container"><div class="aui-flag" aria-hidden="false" id="upgrade-notification" application="JIRA" severity="warning"><div class="aui-message aui-message-warning warning closeable shadowed"><div class="body">We are working to solve intermittent issues with the Active Directory. That is why JIRA may not let you authenticate. If so, try again in a few minutes and apologize for any inconvenience!</div></div></div></div>
</div>
<div id="alert-ACME-reboot" style="display: none;">
<div id="aui-flag-container"><div class="aui-flag" aria-hidden="false" id="upgrade-notification" application="JIRA" severity="warning"><div class="aui-message aui-message-warning warning closeable shadowed"><div class="body">Today <b>OCT-9th</b> at <b>16:15h</b> JIRA will be restarted due to maintenance tasks. The downtime will last about 15 minutes. Sorry for any inconvenience caused.</div></div></div></div>
</div>
I would like to share it with this community because maybe could be useful to someone. I also would like to know the opinion of you experts and any advices to correct or improve this code will be welcome.
Hi! I guess so. Look at the code, the trick is simply find any "div" or other html element by id, that let you know that you are certainly on the right screen where you want to show your banner. So, navigate to Tempo plugin, show browser develop options and search for any div ID that let you assure you are at Tempo plugin screen.
I think a simple "&&" condition with "#tempo-container" and maybe "#myWorkCalendarContainer" (just for main page), will work for you. Give it a try and tell me...
(but I'm no longer Jira admin, nor jira developer, I can't test it for you, sorry)