Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Replace \ with /

Peter_Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 2, 2019

Hi,

I've been trying to replace \ with / as a user macro so that users can paste in links to windows file paths and have them function when you click on them.

I've tried  $param.filePath.replace("\", "/") and replaceAll and \\ and \\\ and \\\\.

Page displays an error and the logs say: ParseErrorException: Encountered "file" at getRenderedContent[line 0, colum 10]"

If I try $param.filePath.replace("A", "B") that works fine.

Anyone got any suggestions?

Cheers

1 answer

0 votes
Peter_Smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 2, 2019

I found a solution.

 

#set($slash = '\')

#set($replaced = $paramFilePath.replace($slash, "/"))

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events