Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,004
Community Members
 
Community Events
168
Community Groups

Velocity - expression as argument?

Method as an argument DOES work (as opposed to what I thought first), but it doesn t make sense in this case:

$space.key.substring($space.key.length())

What I actually wanted:

$space.key.substring($space.key.length() - 2)

But the expression as an argument doesn t work. Should it?
Thanks
G.

2 answers

1 accepted

1 vote
Answer accepted
## @noparams
#set($len = $space.key.length() - 2)
$space.key.substring($len)

Workaround with var

not testet but try

$space.key.substring(${space.key.length()} - 2)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events