Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hello,
I was mimicing the Confluence Space IA plugin to create a space admin button in our template.
the line:
<link id="spacebar-settings-link">/spaces/spacetools.action?key=$generalUtil.urlEncode($helper.spaceKey)</link>
the final render doesn't seem to render correctly, I see the string literal instead of the actual space key.
What am I missing? I didn't see anything obvious in the atlassian-plugin.xml, and I couldn't find a help page outlining the usage.
Thanks!
So it turned out the $helper is not a accessible by default object.
I ened up with:
<link>/spaces/spacetools.action?key=$generalUtil.urlEncode($space.key)</link>
thanks all for the suggestions.
I discovered that in JIRA, JiraWebActionSupport has method urlEncode, thus I could just do the following in my Velocity template:
$action.urlEncode("my/unsafe/url")
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Pinn, Yep. But I found my way around it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try
$action.helper.spaceKey
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was close, but it was the $helper object that was null. I ended up using:
<link>/spaces/spacetools.action?key=$generalUtil.urlEncode($space.key)</link>
I guess I saw the helper so much I thought it was there by default.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you say 'I see the string literal' do you mean that you see '$helper.spaceKey' in the output?
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.
with Confluence, GeneralUtil is always in the velocity context. it's one of the default objects.
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.