Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8393083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:41:34+00:00 2026-06-09T19:41:34+00:00

I have a velocity template (in a Confluence user macro) that looks like: ##

  • 0

I have a velocity template (in a Confluence user macro) that looks like:

## This macro takes a jiraissues macro in the body with "Show Total Only" configured to TRUE.
## It then parses the return and puts a green check if the number returned is ZERO or a red X otherwise.
## @noparams 

#set ($start = $body.indexOf("{") + 1)
#set ($end  = $body.indexOf("}") )

Printf debugging...<br />
body.substring($start, $end) = $body.substring($start, $end) <br />

<ac:rich-text-body>
  <ac:image ac:thumbnail="false">
## BUG BUG This substring is ALWAYS zero.  Dunno why.
  #if ($body.substring($start, $end) == "0")
    <ri:url ri:value="/images/icons/emoticons/check.png" />
  #else
    <ri:url ri:value="/images/icons/emoticons/error.png" />
  #end
  </ac:image>
</ac:rich-text-body>

This template has a nested other velocity template that is configured by the user to query a DB and return the number of bugs that match some criteria. The idea is that if the number returned is ZERO, then everything is hunkydory. Otherwise, well… you get the picture.

Now, there’s something CLEARLY screwed up in my thinking.

  1. The $body string seems to returns something that looks like {0} issues.
  2. The {0} seems like a variable or something, but hell if I can find any documentation.

Questions

  • Which template gets evaluated first?
  • Can I even base the logic of one template on the output of another?
  • Why is my life like this? Never mind, I know the answer to that one.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:41:35+00:00Added an answer on June 9, 2026 at 7:41 pm

    A string like {0} suggests that what you see isn’t the actual end result, but a message template that is supposed to be filled in with real data. And to me it looks like a key used by MessageFormat, but it could be something else.

    Do you happen to have the code for the inner macro as well?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have velocity template like this one : +-----------------------------------------------------------+-------------+-------------+-------------+-------------+ | $totalPel Pelanggan | $totalBk
I have an array set inside a velocity template that contains some paths. The
I have a resource (velocity template) which I'd like to be able to swap
I have a project that generates HTML pages using a Velocity template and Java.
I have this velocity template. It works fine in one case, but doesn't in
Dotcms does have a nice template system based on velocity, but it seems like
I have a variety of Velocity template files that represent e-mail messages. I am
I have a velocity template which has a nested table. I want to align
I have non-ascii chars in velocity template files. And when processed they are garbled.
I have a spring web app that uses Hibernate and Velocity. It's an MVC

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.