Using the Announcement Banner for specific projects

Ashley Roberts March 14, 2023

We are using Jira Software Data Center v8.20.13 and was wondering if it is possible to set the Announcement Banner for specific projects?

We want to have people see this in only certain projects and not all projects. At the moment we have a message that is universal to all projects. 

2 answers

0 votes
Brant Schroeder
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 9, 2023

@Ashley Roberts You can just ad an else statement so all other projects would have a different message than the one project, in this case DEMO.

<p style="display: none;" id="demo">Demo Announcement</p>
<p style="display: none;" id="messageforallprojects">Demo Announcement</p>
<script>
       if (window.location.href.indexOf("projects/DEMO") != -1) {
          document.getElementById("demo").style = "display: block;";
       }
       else
       {
          document.getElementById("messageforallprojects").style = "display: block;";
       }
</script>

You could make it even nicer by just having a single div and defining the text in the div in the script as well.

Ashley Roberts April 11, 2023

In the section "display: block;"; would I need to put the message with its formatting for each of the messages that I want to have?

E.G.

<p style="display: none;" id="MUAS"><span style="font-family:Verdana; background-color:#FFFF82; float: left; width: 34%; text-align: left;"><strong>AU</strong> People <strong>ONLY</strong></span>
<span style="font-family:Verdana; background-color:#FFFF82; float: left; width: 33%; text-align: center;"><span>Check to make sure the information has been checked </span><span style="font-family:Verdana; color:#CC0000"><strong>Please</strong></span></span>
<span style="font-family:Verdana; background-color:#FFFF82; float: left; width: 33%; text-align: right;"><strong>AU</strong> Persons <strong>ONLY</strong></span>

0 votes
Barnali Putatunda
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.
March 15, 2023

You can make some tweak to the announcement banner code, to put some condition like where to show this.

The below code will show the banner when you navigate to the project. In this example project key is DEMO

<p style="display: none;" id="demo">Demo Announcement</p>
<script>
       if (window.location.href.indexOf("projects/DEMO") != -1) {
          document.getElementById("demo").style = "display: block;";
       }
</script>



Hope this helps!

Ashley Roberts March 15, 2023

Thank you for that and that worked.

But I was wondering if you can have a different message for other projects?

What I mean is a global message for all the other projects and have the above for the specific project I want a different message for.

Gabriella
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 28, 2024

how would you add more than 1 project?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.13
TAGS
AUG Leaders

Atlassian Community Events