I'm looking for a way to quickly embed some plain text output from a REST API (TeamCity) in a Confluence wiki page. I can't use the html-include macro, as it expects html and throws an error otherwise. The lone plugin that seems relevant hasn't been updated since many Confluence releases ago. I don't want to use the plugin or the TeamCity build status widget. I just need a little data from the server to sprinkle onto the page content I already have. Is there no way to just include the raw output from a URL regardless of its response type?
At a minimum, you can script it - Script Plugin for Confluence. Or you could treat the data returned as csv and use the CSV macro with the url.
I went with the CSV and it worked great Bob, thanks! All I needed was the url attribute with the macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please share the sample code Troy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey sorry for the delay! Took me a while to find the code.
I went a different path after the CSV macro went paid (not that I didn't like the add-on, the functionality just wasn't important enough for the price given our seat count).
But if you have the add-on, use it like so:
{csv:url=http://teamcityserver/guestAuth/app/rest/builds/buildType:dev,status:SUCCESS,lookupLimit:1/number}{csv}
Which would return the build number of the most recent successful "dev" build.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Troy - which alternate route did you go with? (non-paid). Thanks in advance.
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.