Having trouble getting the size of a passed in String[] object. I can access individual elements fine with "$var[x]", but trying "$var.size()" results in a NullPointerException being thrown by the velocity template object.
Am I misunderstanding the docs? Or does JIRA not use Velocity 1.7?
Yes, Jira use velocity.
If both $var.size() and $var.length() comes with the same error,
Then you better check that you pass/access your "var" correctly...
Try also ".size()" or ".size"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
None of these seem to work. I just switched to using an ArrayList<String> object. That seems to have worked fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jackson,
Confluence uses Velocity, not sure about Jira. Try $var.length()
Best
JP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've tried ".length" and ".length()", both being displayed as text instead of being interpreted. I've used ".getClass()" to confirm that the variable being passed in is a String[]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.