Can I use the Jira rich editor in my plugin?

Harald Ratzberger August 5, 2017

I wan't to use the jira rich editor (the editor of the description in the issue view) in my own plugin page for editing my custom field.

Is that possible?

2 answers

0 votes
Mahmoud Ahmed Abdel-Mola April 8, 2019

What you need to add is the web-resource for the jira editor, you can require the resource like this:

 

pageBuilderService.assembler().resources().requireWebResource(
"com.atlassian.jira.plugins.jira-editor-plugin:init");
0 votes
Maarten Cautreels
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 5, 2017

Hi Harald,

That shouldn't be a problem. More info (including tutorials) can be found on the Developer Docs.

Hope this helps.

Best,

Maarten

Harald Ratzberger August 8, 2017

Thx. I will try that asap.

Harald Ratzberger August 9, 2017

Unfortunately , the links didn't contain what I needed.

What I have so far is:

A WebPanel:

<web-panel key="audit-structure-page" location="com.atlassian.jira.jira-projects-plugin:auditstructurepage">   
<resource type="velocity" name="view" location="templates/panel/audit-structure.vm"/>   
<context-provider class="com.soso.ism.project.panels.AuditStructureContextProvider"/>
</web-panel>



A Context Provider where I add the rederer descriptor:

JiraRendererPlugin renderer = ComponentAccessor.getRendererManager().getRendererForType("atlassian-wiki-renderer");
JiraRendererModuleDescriptor rendererDescriptor = renderer.getDescriptor();
context.put("rendererDescriptor", rendererDescriptor);
context.put("rendererParams", Maps.<String, Object>newHashMap());


And my .vm file where I add the RichEditor:


#disable_html_escaping()
$!rendererParams.put("rows", "5")
$!rendererParams.put("cols", "35")
$!rendererParams.put("wrap", "virtual")
$rendererDescriptor.getEditVM("Test", "null", "atlassian-wiki-renderer", "responsible", "responsible", $rendererParams, false)


What I get is that:

p1.png

What I want is that:
p2.png

It seems there is missing some CSS and/or JS. Any ideas?

Thx


Harald Ratzberger August 9, 2017

I found out one more thing. If I deactive the new RichText Editor (what I want) the old RichText Editor in my page works as expected and doesn't show the original Text ("Test" without style) over the blue icon.

 

It looks like the activated new RichText Editor messes up the old  RichText Editor.

Alessandro Vincelli December 5, 2018

Hi Harald, I found the same issue, Did you solve it?

Suggest an answer

Log in or Sign up to answer