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.
Result
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: https://github.com/laschi23/confluence-banner
I am very grateful for all and any feedback
Regards, Dominic