Dynamic Announcement Banners in Atlassian Jira

We’re working with a customer to merge a large number of projects from several Atlassian Jira instances into one. To do this, we migrate a few projects at a time after business hours every other day. What this means is that users see fractured instances for some period of time. To help users understand what is happening, we wanted to give them contextual help. This meant showing an announcement banner that:

  • Gave them directions on where to find their content
  • Was specific, not just “Go to http://NewJiraInstance.com”
  • Only appeared on projects that had been migrated
  • Was easy for us to keep updated as we worked on the project


This was actually fairly easy to put together with some basic HTML and Javascript so we wanted to share this announcement banner drop in snippet with the community:

<!-- Example usage -->
This project's key is: <div class="dynamicProjectKey"></div>
Remember that your content has moved to: https://example.com/jira/projects/<div class="dynamicProjectKey"></div>

$(document).ready(function () { 
	let pkey = ""
	if (document.location.pathname.match("/([A-Z]+)-")[1]){
		pkey = document.location.pathname.match("/([A-Z]+)-")[1]
	else if (document.location.search.match("projectKey=([A-Z]+)")[1]){
		pkey = document.location.search.match("projectKey=([A-Z]+)")[1]
	else if (document.location.pathname.match("/projects/([A-Z]+)")[1]){
		pkey = document.location.pathname.match("/projects/([A-Z]+)")[1]

	let targetProjects = ["ABC", "DEF", "GHI"]

	if (targetProjects.includes(pkey)){
		$(".dynamicProjectKey").each( function(index, element){ 
			$(this)[0].innerText = pkey 

This is a very simplified version of what we did, but we hope that it demonstrates just how easy it is to show dynamic content to your users

If managing complex announcement banners is an ongoing need of yours, you should check out the Announcer for Jira app (they also have a Confluence, and Bitbucket version) on the Marketplace.  A little birdie told me they may be adding project as a variable in the future.