Dynamic Macro Browser Parameters/Options

Sean King
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 22, 2012

I'm wanting to create a user macro that changes the parameters displayed in the macro browser based on the first few values chosen. For example, the first parameter might be a boolean asking if the user has an image, if they select true, then an input box will show up in the macro browser for them to put the url in. If they don't select true then the box is hidden.

Is this possible? If so how?

1 answer

3 votes
EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2013

Yes, it should be possible.

You can get access to any of the fields in the macro browser dialog with this little snippet:

AJS.MacroBrowser.getMacroJsOverride("macrno-name").fields.string = {
  "field-name": function(param) { //do stuff }};

You could then possible bind an on change event to the field to take action against the second field.

https://developer.atlassian.com/display/CONFDEV/Including+Information+in+your+Macro+for+the+Macro+Browser

Sean King
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2013

The documentation you linked to was for creating plugins. Does this work on User Macros too? I'm wanting it for a User Macro.

Suggest an answer

Log in or Sign up to answer