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

How to get macro input parameters

Terje Røstum October 15, 2020

I'm trying to set up a macro using atlassian connect (express). This macro requires a custom editor with some custom input parameters. 

This works just fine for the preview which gets called with all the parameters in the url, but when loading my custom editor i cannot understand how to get a hold of the macro params. My first thought was that the editor url got called with these params in the query, but no. Should they be?

This page in the documentation: https://developer.atlassian.com/cloud/confluence/modules/dynamic-content-macro/ 

has an example where they use the Atlassian JS API and calls "getUrlParameter", but without the input params in the url, that doesnt help much.

So i am a little confused.

2 answers

0 votes
Frank Lippes August 19, 2021

Perhaps a little late, but I ran into the same question and by trial and error I found out you can add them to the url yourself in atlassian-connect.json:

"url": "/path?space-key={space.key}&page-id={page.id}&labels-to-ignore={labels-to-ignore}"

Where labels-to-ignore is a custom parameter.

In my js code, I can reference it in an app.get route handler like so: 

let labelsToIgnore = req.query['labels-to-ignore'];

0 votes
Diego
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2020

Hello @Terje Røstum !

As I understand, you need some assistance with the development with a software solution for Confluence Cloud.

I would like to share with you the existence of our Sister Community, the Developer Community. You can check more topics and share your own inquiries here:

There you will share your questions and needs directly with a plethora of capable developers that work with our platform!

Let us hear from you.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events