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.
@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.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how would you add more than 1 project?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.