You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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:
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.
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.
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 :)
Scrum Master / Confluence Administrator
192 accepted answers