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

How do I access user group in Custom HTML?

Jiawenzhong888 October 16, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
October 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!

Jiawenzhong888 October 23, 2020

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
AUG Leaders

Atlassian Community Events