How to get ScriptRunner banner to persist in Bitbucket?

Mary Slocum July 5, 2018

Hello,

I have added a simple banner using the Script Console. I can see the banner using IE and Chrome, but others do not see it.

 

Is there something I'm doing wrong? Does it take time to persist?

 

package com.onresolve.bitbucket.groovy.test.docs.webitems

import com.onresolve.licensing.DynamicModulesComponent
import com.onresolve.scriptrunner.runner.ScriptRunnerImpl

def dynamicModulesComponent = ScriptRunnerImpl.getPluginComponent(DynamicModulesComponent.class)

def moduleName = "announcement-panel"

def writer = new StringWriter()

writer.write("""
<web-panel key='announcement-panel' location='bitbucket.notification.banner.header'>
<resource name='view' type='static'>
<![CDATA[
<div class='aui-banner aui-banner-error' role='banner' aria-hidden='false'>
<strong>NOTICE!</strong>: New Add-On available for testing.</div>
]]>
</resource>
</web-panel>
""")

dynamicModulesComponent.unregister(moduleName)
dynamicModulesComponent.register(writer)

 

Is there a better way to do an announcement banner?

 

Thanks,

Mary

1 answer

0 votes
adammarkham
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.
July 6, 2018

Do you see the regular Bitbucket banners? For example the one that is displayed when there is a base url mismatch? If you don't then sounds like a problem on Atlassian's side as we use the same method as they do.

Are there any errors in the browser console when you view the page in for example Firefox?

Mary Slocum July 7, 2018

Thanks for the guidance! In the end, it was an issue with the others' browsers not being correctly cleared.

adammarkham
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.
July 8, 2018

No worries. Glad to hear a hard refresh sorted this out for you.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events