announcement banner customization

Fulvio Barbella April 5, 2018

Hi there,

 

Is it possible to add a javascript function in the announcement banner?

 

I'd like to add a function that show a dialog box before exit browser.

 

(My goal is to "force" users log daily work on issues)

 

Thanks

7 answers

1 accepted

0 votes
Answer accepted
Fabio Racobaldo _Herzum_
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 5, 2018

Hi Fulvio,

sorry but on the cloud JIRA you can't add javascript to the announcement banner.

You can not put in place this requirement.

Ciao,
Fabio

1 vote
Fabio Racobaldo _Herzum_
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 5, 2018

Hi Fulvio,

 

you can do that. You need just to add tag script within annoncement

<script>

jQuery().ready(function() {
....
<YOUR CODE HERE>
....
});

</script>

Hope this helps,

Fabio 

0 votes
Fulvio Barbella April 5, 2018

That's too bad :(

 

Thanks for the help anyway :)

Fabio Racobaldo _Herzum_
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 5, 2018

There are a lot of limitation using JIRA Cloud.

You're welcome,

Fabio

Chris M. March 25, 2021

Hi Fabio, 3 years later, is there any way for admins to include custom javascript in Jira Cloud, as you can in server? Is there any policy against add-ins that might allow this? I really think it should be at the organizations discretion to customize the UI this way, and not having that ability will make migration a challenge.

Fabio Racobaldo _Herzum_
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

Hi @Chris M_ ,

unfortunately you can't do that.

Marc Muhlestein August 5, 2021

Boo!  I would like to have the ability in cloud to change the background color of the announcement section to Red. We use this for IT outages so that when we get people creating a ticket they will know there currently is an outage that our IT support desk is working on. 

Is this possible in cloud? 

Chris M. August 6, 2021

Hey Marc, you might appreciate the tools available with the Power Scripts for Jira add-in, particularly the SIL Panels and this Live Fields function lfExecuteJS - Power Scripts™ for Jira 4.0 - Confluence (atlassian.net)

This kind of tool is going to be crucial to making any kind of transition from Server possible for many growing businesses.

-edit-

Looking at the documentation closer, it looks like cloud support may not be in place for this yet (if at all possible). This is incredibly frustrating.

0 votes
Fulvio Barbella April 5, 2018

Hi Fabio,

 

I've tried the code you've posted, but I can still see the entire code :/

 

It seems javascript's not working properly on my Jira Cloud :(

0 votes
Fulvio Barbella April 5, 2018

Hmm, I've tried it with this code:

 

<script>
jQuery().ready(function(){ window.onbeforeunload = function (e) { e = e || window.event; // For IE and Firefox prior to version 4 if (e) { e.returnValue = 'Sure?'; } // For Safari return 'Sure?'; };
});</script>

 

but it shows the entire code :/

Fabio Racobaldo _Herzum_
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 5, 2018

Hi Fulvio,

if you try this code you can figure out that this approach works

<script>

alert("Script works");
</script>

I had not chance to test your script 

Ciao,

Fabio

0 votes
Fulvio Barbella April 5, 2018

Hi Fabio,

 

not yet, I'm goin' to test it in a couple of hours :)

 

Thanks

0 votes
Fulvio Barbella April 5, 2018

Thanks Fabio,

 

is this code going to work properly?

 

<script>
jQuery().ready(function(){ window.onbeforeunload = function (e) { e = e || window.event; // For IE and Firefox prior to version 4 if (e) { e.returnValue = 'Sure?'; } // For Safari return 'Sure?'; };
}); </script>

 

Maybe I should format the dialog in Jira style :/ 

Fabio Racobaldo _Herzum_
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 5, 2018

Hi Fulvio,

did u test it?

Yong September 26, 2022

image.png

Chris M. January 4, 2023

In Jira Cloud it seems they've decided to htmlencode the whole banner string so that html is not parsed by the browser. They could allow this by omitting this step, instead we'll have to wait until automation add-in vendors get a stable version of the UI toolkit so we can emulate some of the functions we need. Really I'd like to see a system option that allows html & js in the banner instead, even if it is "at your own risk."

Suggest an answer

Log in or Sign up to answer