Confluence Custom Macro Development: feasibly request
Asked by James Flowers:

Howdy --

Recently, my team has started using Confluence as a complete knowledge base around our infrastructure and requirements. It's a rather large effort transferring years of knowledge into any system, and I just have a question on the feasibility of custom macro's. Also I apologize if I'm not using the appropriate terminology -- I might actually want a widget or site link or some other term, but please bear with me.

The idea we've embraced is Confluence is the authoritative copy of our documentation -- the up to date, relevant place to find information. This works for a lot of things, but what if an external service is really where the data **is** -- when making changes, you have to update it in two places. I, being a good developer and adhering to the DRY principle, see this as suboptimal and have seen some documentation online where you can write custom macros in eclipse. It's a bit unclear to me (hence this question) on how far you can take it, and if any of this is available in the Cloud offering (or if there is an alternative)... but lets take a look at this case study.

I use a load balancer, but it has a cumbersome UI and various things can change it. However, it does contain one important thing used by my team to monitor/maintain our environment, namely, server pool membership -- which IPs are active serving requests. I want to have this knowledge in Confluence so I don't have to worry about all the hard things like user access, user training, etc... but I need to ensure the confluence data is up to date. If the load balancer is the authoritative copy, ideally, I want to reference it directly from confluence. Is this possible using a custom built macro, or widget? If so are there any good guides you guys could link to for Confluence Cloud specifically? The way I envision it is pretty simple, regular requests to the load balancer API with some sort of caching if that's provided in the platform. I'm a developer, I can figure out how to do it, I'm just not familiar with the limitations and constructs of Confluence itself.

Thanks in advance,

James


Answers:
author: Robert Massaioli _Atlassian_
body: Hi James. Let me first try and make sure that I understand what your requirements are:

* You have data that is external to Confluence but is the authoratative source of information.
* This data cannot easily be imported into Confluence once; but will rather have to be re-imported multiple times.
* This may be the case for many different sources of data.

And your question is: how do I ingest these data sources into my cloud instance?

The answer to your question, in a word, is Atlassian Connect: <http://developer.atlassian.com/static/connect/docs/guides/getting-started.html>

What you want to do is:

* Write an Atlassian Connect service that integrates with these other data sources.   
  (Using whatever security methods that you want / need)
* Write Confluence Macros in this Atlassian Connect addon so that you can surface the data in any Confluence pages.
* Upload this Atlassian Connect addon to the Atlassian Marketplace as a free BUT private addon so that only you can install it on your own instance.
* Actually install it on your instance.

This solution obviously requires you to be a software developer or to get your hands on one. But it will give you exactly what you need and I see nothing blocking you from doing this to solve your very specific data ingestion needs.

comments: author: peterb
body: A dynamic content macro sounds like what you need. Read the first paragraph at this link to see if you think it fits your use case:<https://developer.atlassian.com/static/connect/docs/latest/modules/confluence/dynamic-content-macro.html>


author: James Flowers
body: Thank you for the information. This point in the right direction is what I needed.


Tags: cloud

confluence-cloud