Similar to the regex response in:
I am trying to send a file path through 'Send web request' in global automation. The file path looks like C:\Users\Company\Person\Documents\Folder\File\Base
When this is processed as {{issue.fields.customfield_10030}} I get an error for \\F as a bad json exit. I have tried to use {{issue.fields.customfield_10030.replaceAll("\\\\F","\\F"}} - which works, but is not robust. When I tried to be more intelligent using regex, I can't seem to get the $1 to work.
{{issue.fields.summary.replaceAll("\\\\([A-Za-z])","\\$1")}} this just makes it a literal $1 and no backslash is processed either: C:$1sers$1ompany$1erson$1ocuments$1older$1ile$1ase.
Ultimately, the root issue is sending the raw \\\\ to json is causing issues. Solving that would be best, but a regex to replaceAll that works would be the next best thing.
Hi @Blake Berk -- Welcome to the Atlassian Community!
First thing, I would try using the JSON encoding text functions without replacing anything: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#jsonEncode--
If that does not help, try using the replace() function with plain text rather than the replaceAll() function with regex.
And if that does not help, please post the following for context to help the community offer better suggestions:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.