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

User id in HTML Macro in confluence

sanan sanan January 24, 2018

Hi,

I am using HTML macro in Confluence and want filter the data in a field on the basis of user who is logged in. 

Can somebody help me how to detect in the html macro, the current user who is logged in Confluence? will be a great help.

Thanks

Sanan

1 answer

0 votes
Stephen Deutsch
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.
January 25, 2018

Hi Sanan,

In Javascript, you could use AJS.params.remoteUser to get the current logged in user's username.

sanan sanan January 25, 2018

Hi stephen,

thanks for your reply. I will try it out and let you know what happened.

 

Regards

sanan

sanan sanan January 25, 2018

Hi Stephen,

This realy works. Infact, it can work from javascript file also I have on the server.

I have one more question. AJS.params.remoteUser gives back the userid . is there any way to get the full name of user?

The data I have have is mapped to the full username . if can catch full user name in the html macro then I can just compare and match with the user name column in the datasheet.

Regards

sanan

sanan sanan January 25, 2018

OK. i got it. is AJS.params.currentUserFullname

Stephen Deutsch
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.
January 25, 2018

Good, you could also get it as AJS.Meta.get("current-user-fullname")

That searches through the <meta> tags on the page, which also have some extra information.

sanan sanan February 20, 2018

Thank you, Stephen. 

will definitely try your tips out.

 

Regards

Sanan

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events