Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I access user group in Custom HTML?

I have a 3rd party analytics setup to track confluence user interaction, and I want to enable the tracking based on the user group, for example, only track if users are from group 1 or group 2, if group 3, the analytics will not track. But I am having trouble accessing the user groups in the Custom HTML (where I put my analytics tracking code). 

I know that the user macro can access these user attributes, but I am not able to use the macro in the Custom HTML, I tried to use AJS.params, but the list of attributes in the params doesn't contain user information.

Is there a way to get the user group in Custom HTML?

1 answer

0 votes
Diego Atlassian Team Oct 22, 2020

Hello @Jiawenzhong888 !

As I understand, you need to check if specific users are part of a set of groups within your Confluence Site.

As far as I know, this can be achieved by retrieving the group members via group id when using REST API. You can check more details about it here:

You can get your external tool to send a REST call to Confluence and then work with the provided data.

One more thing! Since your solution deals with external development for Confluence, you can find more in-depth knowledge about development in our sister community. I am talking about the Atlassian Developer Community!

Take a look here:

It is a good idea to share your needs there as well!

But I am using the Confluence Custom HTML, not outside of Confluence though. Can I still use the API?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Confluence Cloud

🎨 Add some visual life to your templates

Hi Atlassian Community, My name is Avni Barman, and I am a Product Manager on the Confluence Cloud team. Based on feedback from you, we are giving admins more power to create templates that a...

133 views 1 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you