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
Community Members
Community Events
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:


What I actually wanted:

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

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

2 answers

1 accepted

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

Workaround with var

not testet but try

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

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events