User Macro to Watch for New Blog Posts in a Space

Heth Siemer
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.
October 13, 2021

Is there a user macro I can create that would allow users to click on it and it would have them watch for new blog posts in a space? I would like to put a button on my blog's home page that would allow them to watch all blog posts in the space?

The out of the box watch functionality when you click on "watch" on the home page does not allow you to just watch for new blogs. You can watch for all content, but we only want the blog notifications. Is this possible?

1 answer

1 vote
Dominic Lagger
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.
October 25, 2021

Hi @Heth Siemer 

There are 2 options for you.

First option: Out of the box from confluence. Click on a space on the left the "Blog" link. then on the right you have the option, to "Watch the blog"

image.png

Second option:

I wrote a user macro:

## Macro title: Watch Blog Button
## Macro has a body: N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Dominic
## Date created: 18.07.2019
## Installed by: Dominic

## This is an example macro
## @param spacetitle:title=Space Title|type=string|required=true|default= |desc=Den Titel, welcher im Button angezeigt wird
## @param spacekey:title=Space Key|type=string|required=true|default= |desc=Den Space Key von dem Space, welcher du abonnieren willst.

<button id="twtr-watch-space-blog" class="aui-button">Abonnieren den $paramspacetitle Blog</button>
<script>
AJS.toInit(function(){
AJS.$('#twtr-watch-space-blog').on('click', function(){
addBlogWatcher();
});
});
function addBlogWatcher(){
jQuery.ajax({
url: AJS.contextPath() + "/spaces/addspacenotification.action?contentType=blogpost&key=$paramspacekey&atl_token="+AJS.Meta.get('atl-token'),
success: function (xhr) {
AJS.$('#twtr-watch-space-blog').text('Du hast geraden den Blog abonniert.');
AJS.$('#twtr-watch-space-blog').attr('disabled','disabled');
}
});
}
</script>

Regards, Dominic

Heth Siemer
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.
October 27, 2021

Howdy Dominic,

That user macro looks exactly like what I want, I'll definitely give it a shot! Thank you so so much!

Marco March 18, 2024

Hi @Dominic Lagger your solution worked really well during the last years 👍

Unfortunatly, in our instance, with the updated to Confluence 8.5.6 this user macro stopped working :(

Do you or another reader happen to know of an 8.5 compatible solution?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events