I want to write a user macro in confluence which will display url of a change ID

Soham Das April 20, 2021

I want to write a user macro in confluence which will take input of a change iD and the output will be a clickable url to the change ID. What we need to do is just append the change ID text to a static string and display it as URL. Can someone please provide the code and logic to do that?

1 answer

1 accepted

1 vote
Answer accepted
Dominic Lagger
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.
April 20, 2021

Hi @Soham Das 

This should work, if I understand you correctly :) 

Feel free to adapt it

## Macro title: My Macro
## Macro has a body: Y or N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: My Name

## @param change:title=Change ID|type=string|required=true|desc=Description here

<a href='LINK $paramchange'>Link Text</a>

Regards, Dominic

Soham Das April 22, 2021

Hi Dominic,

Can you please tell how to take in the input(i.e the change id)?

Dominic Lagger
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.
April 22, 2021

Hi @Soham Das 

What you mean by how to take the input? 

The input is the parameter. You have to set the parameter in the macro on the page, where you use the macro. 

Soham Das April 23, 2021

Sorry Dominic,

I got it. The given template works fine. Thank you 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events