Forums

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

Formatting WYSIWYG for Jira description using virtual functions

Brian Karst
Contributor
June 3, 2020

I am having trouble getting my ConfiForm WYSIWYG Simple editor fields to be in the proper format for the description in the created Jira Issue. If I use the escapeJSON virtual function the description contains the HTML <div><ol><li> code. If I use the renderAsText virtual function it errors but gets rid of the HTML. I have seen a couple different errors, unterminated string, expects , or } etc.  If I train .renderAsText.escapeJSON the HTML is still in the description, if I train .escapeJSON.renderAsText it errors.

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
June 3, 2020

Hi

You need to use 

.extractText.escapeJSON

as "renderAsText" is for the wiki markup to render as text

Alex

Brian Karst
Contributor
June 3, 2020

Hi Alex,

.extractText removes all new lines, number lists, and bullet lists from the input that I would like to keep. I mean it is the whole reason to use the WYSIWYG instead of text area, so the user can input without knowing how to hard code text edits right?

 

Thank You,

Brian

Alex Medved _ConfiForms_
Community Champion
June 3, 2020

Well, that is correct.

It removes the markup and this is what works for description field in Jira. It simply cannot accept the HTML you are trying to transfer from a wysiwyg field in ConfiForms

Brian Karst
Contributor
June 3, 2020

But Jira can handle Wiki Markup (or is it markdown?) right? I mean I can hard code asterisks for bullets and \n for a new line with no issues. I can't find a virtual function to turn the HTML into Wiki markup, but two to convert to HTML (renderAsHtml & renderWikiMarkup) It seems like there should be a virtual function to translate the other way around right? As always, thank you for all your help Alex, even if what I want to do can't be done. 

Alex Medved _ConfiForms_
Community Champion
June 3, 2020

Yes, that is correct - you can have a wiki markup in Jira, but not wysiwyg (you can have wiki markup in ConfiForms as well, but this is another field type)

That's the problem here - Jira cannot accept the HTML..

Brian Karst
Contributor
June 3, 2020

What field is that? The only field I found that has an editor is the wysiwyg. I tried the markdown editor but for all I can tell that is just a text area field; certainly has no editor bar. Does it just automatically escapeJSON or something? 

Are there any efforts to create a virtual function to take the html input from the wysiwyg and convert it into markup? That would be a very powerful VF that I would think you have the groundwork laid down for with the renderWikiMarkup or renderAsHtml VFs

Alex Medved _ConfiForms_
Community Champion
June 15, 2020

Looks like it might be possible... https://community.atlassian.com/t5/Jira-questions/How-to-convert-html-to-Atlassian-markup-in-java-app/qaq-p/657726

We will do some research to see if this can be added to ConfiForms virtual functions

Like # people like this
Alex Medved _ConfiForms_
Community Champion
June 16, 2020

Experimental function for converting HTML to wiki markup has been added  to the https://wiki.vertuna.com/display/CONFIFORMS/Release+Notes#ReleaseNotes-Version2.13.2

Like Brian Karst likes this
Brian Karst
Contributor
June 18, 2020

I'm excited to try it! Sometimes I wonder if you are man or machine Alex. Or perhaps a multi-user account. You are so supportive, Thank You.

Brian Karst
Contributor
June 19, 2020

Unfortunately it doesn't work for me, but that has nothing to do with the VF. We are well behind in ConfiForms versions (2.3.1) and the request to update was put in well before me. Getting through the red tape has no estimated timeline that I know of.

Brian Karst
Contributor
June 26, 2020

Hopefully in late July or August we will manage to update ConfiForms, and I can try this VF.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events