Need help with Announcement banner script

Diane Burns May 19, 2021

I have the following in the Announcement banner to add a banner to the EDG space, however the banner is also showing on the EDGGD space, which is not moving.  Is this a bug?

Any idea's how to fix this?

<p style="display: none;" id="avail"></p>
<p style="display: none;" id="start">MIGRATION IN PROGRESS - THIS PROJECT IS LOCKED</p>
<p style="display: none;" id="done">MIGRATION COMPLETE - THIS PROJECT IS LOCKED<br>New location: https://lgslabs-jira.caci.com</p>
<script>
if (window.location.href.indexOf("projects/EDG") != -1) {
document.getElementById("done").style = "background-color: palegreen; border: 2px solid red; margin: 4px; padding: 2px; font-weight: bold; text-align: center; display: block;";
}
</script>

1 answer

1 accepted

3 votes
Answer accepted
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.
May 19, 2021

@Diane Burns If you are following the steps here to add an announcement banner it is applicable to all Jira projects.  So you will need to be more specific in your JavaScript.  I believe the following will work for you:

<p style="display: none;" id="avail"></p>
<p style="display: none;" id="start">MIGRATION IN PROGRESS - THIS PROJECT IS LOCKED</p>
<p style="display: none;" id="done">MIGRATION COMPLETE - THIS PROJECT IS LOCKED<br>New location: https://lgslabs-jira.caci.com</p>
<script>
if (window.location.href.indexOf("projects/EDG/") != -1) {
document.getElementById("done").style = "background-color: palegreen; border: 2px solid red; margin: 4px; padding: 2px; font-weight: bold; text-align: center; display: block;";
}
</script>

Diane Burns May 19, 2021

Thank you so much the / after the EDG fixed the issue 

Suggest an answer

Log in or Sign up to answer