- edited description
Can't format Description (using regex) with Format field value
Customers sometimes raise issues using email. Because of colors/styles of the email, the Description field sometimes ends up looking like this:
Dana,
With Dan out, I’ll cc in ITS support, as they should be able to assist.
Thanks,
- Billy
{color:#000000}
{color}{color:#000000} {color}{color:#000000}
{color}{color:#000000} ---------------------------------------------------------------------{color}{color:#000000}
{color}{color:#b20b38} *_Billy Kardasz_*{color}{color:#000000}
{color}{color:#000000} *_Academic Technology & Web_*{color}{color:#000000}
{color}{color:#000000} Wisconsin School of Business{color}{color:#000000}
{color}{color:#000000} University of Wisconsin-Madison{color}{color:#000000}
{color}{color:#000000} 608-265-9717{color}{color:#000000}{color} {color:#000000}{color}{color:#000000} {color}{color:#000000}{color}
{color:#000000}
{color}{color:#000000}{color}
{color:#000000}{color}
I am attempting to use regex to ignore everything after the first occurance of the "{" character. I've found a regex that works for this purpose in Notepad++: {.*$.
Here's the post function:
I expected this to strip everything after the first "{" (which is exactly how it works in Notepad++) but when the issue is created (and this post function seems to execute) the Description remains unchanged.
While it's not an issue for actually viewing tickets (wiki renderer transfers those styles over), I'm using JWT to send an email contianing the Description field. That ends up looking this this:
Any idea why this is happening/what to try next?
Comments (4)
-
reporter -
repo owner Hi @evanwinter,
You can use function
wikiToHTML(wiki_text)
, provided by JWT, in order to transform the wiki format in issue Description into HTML, and store the resulting HTML text into "Ephemeral stirng 1" virtual field.Then you can use Ephemeral string 1 (field code
%{00061}
) in post-function "Send an email" instead of Description (field code%{00001}
) for composing the email body.To do it you should use "Copy a parsed text to a field" post-function before "Send an email" post-function with the following configuration:
-
reporter Thank you! That's a perfect solution. It's working great
-
reporter - changed status to resolved
- Log in to comment