Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Confluence Banner with ScriptRunner

Hi all

In this little article, I want to show you, how I made a Confluence Banner with ScriptRunner with some additional features.

My goal was a confluence banner, which:

  • can be closeable for every user and doesn't show up for this user again
  • is time controlled
  • has to show only for a few user groups.

Yes, I know there are plugins for this, but with 2000 licences, theese are very expensiv and I'm a curious developer. So I did this to find out, can I do this with scriptrunner. 

What I did was a confluence page, a script fragment, a REST Endpoint and a user macro. The confluence page is for the tracking which user has closed the banner.

Before I deep dive, I want to tell you, that this is a dirty way to fulfill my goal, but so far it works quite well.

Script fragment (also see github documentation)
This is the most important thing. I made a script fragment with a condition. In the condition, I made some settings for time, group and whether this user has already read the news banner.

  • pageId
    • On this page I save the users, which clicked on the close button. The informations will be stored in a TextProperty.
  • dateFrom / dateTo
  • groupname

The provider script has the banner and javascript for calling the REST Endpoint.

REST Endpoint (also see github documentation)
The REST Endpoint saves the user which clicked the close button on the created confluence page in the TextProperty

User Macro (also see github documentation)
The user macro reads all the users which are on this page in the TextProperty.


When a user closes the banner, the user macro (in the confluence page) will generate the following table containing the user-data.


So I can track who clicked away the banner and when.

My versions

  • ScriptRunner: 6.10.0
  • Confluence: 7.4.1

All of the Scripts are in my new github project: 

I am very grateful for all and any feedback :) 

Regards, Dominic


Hi Dominic,

sounds very interesting to me!

Where am I able to download the ZIP? I'm looking forward to give you some feedback then.


Like # people like this
Dominic Lagger Community Leader Oct 12, 2020

Hi @Thomas Egger @Patrice 

It seems that i can not upload a zip.
Therefore I uploaded the scripts to github. 

Hi Dominic,

This is awesome! I managed to use your code to get this working in my instance:

Screen Shot 2020-10-15 at 1.54.53 PM.png

I will share this with the rest of the ScriptRunner for Confluence team. We absolutely love to see all the unique ways that people are utilizing our app.



Software Engineer, ScriptRunner for Confluence

Hi @Dominic Lagger,

I tested your script and it works perfectly.

  • Maybe you could improve the documentation so that it is clear for everybody which type of fragment (Custom web item, show a web panel, ...) to use and what to choose in the "Location" field.
  • It would also be helpful to state that the page id in the fragment is only for storage and is not responsible for showing the banner only on that page.
  • Have you already though of a version of your script for Jira?

Thanks a lot for sharing your work!


Dominic Lagger Community Leader Oct 16, 2020

Hi @Thomas Egger 

Thank you very much for your feedback. 

On github, I changed the readme and also this article (reference to github). So it should be a little bit clearer. I also made some changes:

  • Change from StringProperty to TextProperty (StringProperty can only have 255 signs)
  • Add possibility for 3 groupnames, not only one


I thought of a JIRA version, yes. But I didn't try it yet. But in my mind, this should be very easy. In JIRA you need the same fragment. The rest should be very similar, because closing the banner on JIRA could also call the REST Endpoint in Confluence. 

Regards, Dominic

Dominic Lagger Community Leader Oct 16, 2020

Hi @Joshua Yamdogo _ Adaptavist 

Thanks a lot for this awesome feedback! I'm very happy that it worked on your system!

Thanks for sharing it with your team :) ! 

Regards, Dominic


Log in or Sign up to comment
Community showcase
Published in Confluence

Watch 4 Confluence apps compete for Best App Demo in September's Appy Hours

Calling all collaborators! Appy Hours on the Atlassian Community is a monthly event where 4 Partner and app vendor presenters go head-to-head with 5-minute demos for the title of Best App Demo. I...

492 views 0 12
Read article

Atlassian Community Events