Context parameters are not working in Confluence

I’ve deployed a sample confluence add-on https://bitbucket.org/atlassianlabs/atlassian-connect-confluence-example/src/master/ and selected a sports category on the newly created page.

When inspecting the page, I see that the macro parameter is correctly defined in the data-macro-parameters attribute of the element, but it is not passed to the URL. As a result, the service cannot fetch it from the request parameters.

"url": "/macro?sport={sport}"

My confluence space: https://evgeniimironenko.atlassian.net/

Am I missing something?

Hi @EvgeniiMironenko ,

Welcome to the Atlassian Developer Community.

I don’t understand what you mean by a “sports category” and why you believe the context parameter sport would be expanded since this is not one of the pre-defined context parameters documented in Context parameters.

Could you provide more information please.

Dugald

1 Like

Hi @dmorrow

The official add-on sample from AtlassianLabs demonstrates how to select an element (a sports category, in this case) and pass it to a Confluence page.

It uses the approach with additional parameters as described on the page you shared: Context Parameters. See the relevant section in atlassian-connect.json (Sorry, I can’t post more than 2 links in one message).

When I select an element, I expect the sport to be passed to the /macro endpoint, but it is not working.