I'm a developer working on a project and have never used Confluence before. Is there a way to add some custom javascript or a little snippet to a confluence page to let me grab the current user's info and then pass that along?
Details:
1) Confluence web page has a button.
2) When a user clicks that button, I want to use the confluence api to grab the user's info, open a new window to the url with the user's info attached as the query string.
Basically, I just want to know if there's a way add a snippet using the confluence api. I have the api method I need, but am having trouble figuring out how it can be added to the page. One of our customer's uses Confluence for their company and is requesting this feature.
Hi MacGregor,
If I understand correctly what you are wanting to do, to add JavaScript into a Confluence page you need to insert the HTML macro. To do this go to the Confluence editor, click Insert > Other Macros, and search for HTML macro. Then insert it into the page. Inside the HTML macro, you can then add the JavaScript code.
I hope this helps
Well the issue is that the steps to turn on the html macro don't work.
Go to > Add-ons.
The only thing listed that has 'html' in it is 'Atlassian XHTML'.
If you do what you say, the only html macros listed are as follows:
1) HTML Comment
2) HTML Image
3) HTML Table
4) List Item (li)
5) Ordered List (ol)
6) Table Body (tbody)
7) Table Cell (td)
8) Table Head (th)
9) Table Head (thead)
10) Table Rod (tr)
11) Unordered List (ul)
None of these help me out. So neither the steps to turn on the HTML macro work, nor do the steps for adding it (I would presume since it's not enabled in the first place).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi MacGregor,
Are you using Cloud or Server?
If you are using Cloud, you won't be able to use the HTML macro. Although, you can use the Atlassian Connect (https://developer.atlassian.com/static/connect/docs/latest/index.html). This allows you to build add-ons to customise your Atlassian products.
If you are using Server, then you may need your admin to enable the html macro. To do this, please refer to this document: https://confluence.atlassian.com/conf54/confluence-administrator-s-guide/managing-add-ons-and-macros/enabling-and-configuring-macros/enabling-html-macros
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.