Escape sequence in set function


how do I escape characters in the set function?

E.g.  I would like to store a complete javascript function in a variable and then call it later in the template. But as soon as I use "{" in the variable, the script won't work.

Is there an escape sequence for special characters?


This works:

%{var w=4;${myFunction}}


This doesn't work:

${set(myFunction,"function retVal(w){var v=2*w;return v.toString()}"}
%{${myFunction} var w=4;retVal(w)}

1 answer

Hi @Waldemar Friesen,

A ")" is missing on myFunction definition.

Try this:

${set(myFunction,"function retVal(w){var v=2*w;return v.toString()}")}
%{${myFunction} var w=4;retVal(w)}
Rui Rodrigues.

Hi @Rui Rodrigues,

thanks for the quick reply. Sorry for the misspelling. In my test environment the syntax was correct. I tried to copy the code into the comment field, but it always tried to open a new page instead of pasting it into the field... So I had to write it manually and forgot the closing bracket.

This means: It still does not work. As soon as you type an "{" in your variable value, xporter breaks processing.


Simple example:

Line to process: "String without brackets"
${set(varWithoutBrackets,"String without brackets")}
Print out from Variable: ${varWithoutBrackets}
Line to process: "String {with} brackets"
${set(varWithBrackets,"String {with} brackets")}
Print out from Variable: ${varWithBrackets}





I think this is a bug. Either there should be an escape sequence for special characters or xporter should not try to evaluate variable values.


Waldemar Friesen


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

449 views 8 26
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you