JIRA, project specific banner

gunaa saikumar February 4, 2019

 

    • Hi Team,

      Need help as on of the project in Jira is going to be stopped in a month. we need to display banner or meesage to users who select this Project in create issue screen .
      We need to even disable to use this project after few days.
      Please help to display banner when user selects this project and even when a jira is assigned to this group

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Answer accepted
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2019
gunaa saikumar February 4, 2019

can we have something without addon

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2019

Hey Gunaa, 

I did some more research and found a page discussing this. https://community.atlassian.com/t5/Jira-Core-questions/Limit-announcement-banner-to-specific-sections-in-JIRA/qaq-p/166841

I made a modification to the script and was able to get something working similar to what you wanted. This will show up when a user navigates to the project, not when they try and create a ticket for the project. 

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

 

Note: "SP" is the key of my project I want the announcement banner to appear on.

Like # people like this
Dan Chambers
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!
June 5, 2019

This is really helpful, thanks!

Alok.Kumar01
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!
December 9, 2020

This works fine.

Can you suggest how to add multiple (two) projects.

Nag February 4, 2021

@Kian Stack Mumo Systems 

Is there a way to disable a jira banner once user logs in?

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 4, 2021

@Nag

I didn't find a way to do that, but I did find another answer which shows how to make an announcement banner that can be closed by users.

<div id="mycrazyuniqueid" style="display:none;" class="aui-message aui-message-info closeable">
Announcement Banner Text
</div>
<script>
if (AJS.Cookie.read("mycrazyuniqueiddismissed") != "true"){
document.getElementById('mycrazyuniqueid').style.display = 'block';
}
document.addEventListener('click', function (e) {
var msgid = e.target.parentElement.id;
var msgtargetclass = e.target.className;
if (msgid == "mycrazyuniqueid" && msgtargetclass == "aui-icon icon-close") {
console.log("Hide mycrazyuniqueid Info");
AJS.Cookie.save("mycrazyuniqueiddismissed", "true");
}
});
</script>

 

This might be of use to you.  Once they read it they can close it and not see it again. 

Like # people like this
Priyanka khare March 26, 2021

hello @Kian Stack Mumo Systems ,

the script that u wrote above for the announcement banner to appear on SP project, where do we put the script-

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

 

?

@Kian Stack Mumo Systems 

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 26, 2021

@Priyanka khare

You place this in the announcement banner. Instructions for configuring the announcement banner can be found here. Please be aware that you can only configure the announcement banner on a Jira Server or Jira Data Center environment.

 

Thanks!

Gaj Umapathy May 20, 2022

@Eswar Reddy For a banner that can be used for users not logged in you can use Scriptrunner Fragments.

 

Condition:

{code}

import com.atlassian.jira.component.ComponentAccessor

if (!ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser())
{ return true }

{code}

 

Message to display

 

{code}

writer.write("<div style='background-color: white; border: 5px solid red; margin: 5px; padding: 2px; font-weight: bold; text-align: center'>"+

"You are not logged in!")

{code}

Like Nag likes this
0 votes
Fredrik Ivansson Flinta February 8, 2023

I solved this by creating a Scriptunner web-panel fragment. 

Added the "banner" to "atl-header".

Easy to parse the projectkey from the URL by using "window.location.pathname" since the Scriptrunner condition don't work for projects.
Below text from official documentation: 

"It would be preferable to have the message as the actual banner, but unfortunately the current project object is not available to us in that context."

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 8, 2023

That's a good solution! Thanks for sharing!

Like Fredrik Ivansson Flinta likes this
0 votes
Ade Adegoke December 6, 2022

@Kian Stack Mumo Systems is there a way to have this specific jira project banner done for in JIRA cloud?

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2022

@Ade Adegoke, not to the best of my knowledge.

Like Ade Adegoke likes this
0 votes
HP August 29, 2022

@Kian Stack Mumo Systems 

Hi Kian, thanks for the script for display the banner for SP project. It work well

Could you share how can i put the individual banner for 300+ projects in Jira? Thanks!

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 30, 2022

@HP

 

I looked at the Marketplace to see if there were any apps to help. I didn't see anything specific in there. I suppose you could set up if/else conditions in the script I supplied earlier. That would be quite a bit of work though.

HP August 31, 2022

Thanks Kian.

I found this, https://help.k15t.com/backbone-issue-sync/latest/server/configure-a-project-banner-197761575.html#id-.Configureaprojectbannerv5.3-Prerequisites  which can help to show banner for the individual project/issue related to the project.

Thanks

Like Matthias Gaiser _K15t_ likes this
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2022

@HP - nice that you've found the article in our docs. I've also rephrased that help article as an article for the Atlassian Community. If you have any feedback what you improved/changed which might help other people, I'd be happy if you comment on the article.

Like HP likes this
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 6, 2022

@HP

Thanks for sharing!

Like HP likes this

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question