Can't format Description (using regex) with Format field value

Issue #772 resolved
Evan Winter created an issue

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: jwt.PNG

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: jwt3.PNG

Any idea why this is happening/what to try next?

Comments (4)

  1. Fidel Castro Armario 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:

    Captura de pantalla 2017-08-30 a las 12.57.59.png

  2. Log in to comment