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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I change the output of a confluence user macro to be an Integer?

I need to change the output of a user macro to be an Integer or String depending on use. How can I set the output to be "86" instead of an "86 issues" link to jira. Created the user macro linked below in article. Edited macro to output just have count of issues as a jira link. Any direction on how to display results of JQL query as string in confluence would be great.

1 answer

Hi Eric,

Two things worth mentioning:

  • You can't change the output type of macros. Macros always return a String. Of course the String could contain only a number but if we're talking about data types it is still a String.
  • The examples you linked to use Confluence default macros such as "jira" or "jiraissues". Therefore you don't really have control over their output.

I see a few possible solutions to your problem here:

  • You could build your own user macro that doesn't rely on a Confluence default macro and instead makes the request itself. (Could be quite complex and requires good user macro programming knowledge on your part)
  • You could include some JavaScript in your user macro that removes the " issues" part from your result so only the numbers stays. (Probably way simpler, but very janky and generally not advisable)
  • You could use a third party solution like our app PocketQuery. In PocketQuery you could simply set up a JQL REST query that fetches your data. You can then write a velocity template for it that defines how the data should be rendered. In your case this should be very simple. And since you're already building complex user macros to begin with you might find that PocketQuery will make your life a lot easier in many other situations where you want to show data from external sources as well. If you want to give it a shot and have any questions you can always ask our support. We're happy to help! :)

Best regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

429 views 23 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you