Converting HTML to Wiki - the Azure DevOps style

Originally asked by Francis Martens (Exalate) on 21 March 2021 (original question)


Assume that you have an integration between Azure DevOps and Jira On Premise.
Azure DevOps is using html to format multi line fields like description, comments
Jira can use wiki renderer based formats.

The challenge is now to do the conversion between the two formatting styles.
How?


Answer by Francis Martens (Exalate) on 05 April 2021

Hi all

We created a new repository which can be used to convert between wiki and html bidirectionally. There are examples how to convert comments in the readme file.

Check repository here


Comments:

Bhakti Prasad Panda commented on 17 March 2022

Hello Francis Martens (Exalate) ,

I followed the steps mentioned in README.MD file present in https://stash.idalko.com/projects/EXAPUB/repos/transformers/browse and restarted the server after placing those files in shared location of Jira home. We are using on-prem Jira data center.

But it still showing the error which is mentioned in above comment by Charlie Schonken . I am not sure why it is not working. Please help here.

Regards
Bhakti

Answer by Simeon Castle on 23 March 2021

(Jira Server)

Having the same issue with the script processor not importing the class successfully.

I have added the latest jsoup jar to <jirahome>/scripts and added the HtmlToWiki.groovy file to <jirahome>/scripts/com/exalate/transform

(NB, I had to create the folders under /scripts)

After this, I’m still seeing the failed import message in Exalate connection. So, couple of questions:

  • Does the service/server need a restart?
  • Is the HtmlToWiki file and the jsoup.jar in the correct place?
  • The jsoup.jar came as jsoup-1.xx.x.jar, which I renamed to jsoup.jar. Neither of them work. What’s the expected file name?

Thanks!


Comments:

Francis Martens (Exalate) commented on 23 March 2021

Looks all ok.

This is the layout on my dev Jira (dc)

Normally you should not need to restart, but give it a try

Simeon Castle commented on 24 March 2021

Had to schedule in the restart, but a restart of Jira did in fact fix this. Thanks!

Francis Martens (Exalate) commented on 24 March 2021

Exalate is caching the external scripts and it might be the case that once that an import fails, it will remain failing until the add-on is reenabled or the application restarted.

Answer by Julie Metior on 22 March 2021

We’ve just tried to implement this and we get this error when trying to save & publish the script:-


Comments:

Francis Martens (Exalate) commented on 22 March 2021

Julie Metior

Did you deploy the HtmlToWiki.groovy to /scripts/com/exalate/transform ?

Francis Martens (Exalate) commented on 23 March 2021

Question from Julie (by email)

Quick question – in which of these should the script and the jar file be saved in please?

On data center - it should go on the shared home folder.
I will update the readme.md

Francis Martens (Exalate) commented on 23 March 2021

Another question from Julie (by email)

We’re syncing in both directions – is there a solution for Syncing from JIRA to Azure?

This is being worked on as we speak

Julie Metior commented on 23 March 2021

We’ve tried to locate /scripts/com/exalate/transform but our IT team haven’t been able to locate it in our DataCenter backend.

They have asked me to ask you - could you please provide them with a precise location that is relevant to Data Center and also which of the files in the GIT repo they need to place in that location.

Thanks.

Francis Martens (Exalate) commented on 23 March 2021

The folders need to be added by your IT Team

I updated the readme.md on the repo to provide the necessary explaination.
Let me know

James Lindsay commented on 24 March 2021

Hi our IT Team have unzipped the zip file but are not clear on where to put the files, can you please be more specific in regards to datacenter, do we need to create additional folders for these files or where to put them?

the more step by step info for datacenter the better.

Thanks

Francis Martens (Exalate) commented on 24 March 2021

All the details are in the readme.md on the repo

https://stash.idalko.com/projects/EXAPUB/repos/htmltowiki/browse/README.MD

Answer by Francis Martens (Exalate) on 21 March 2021

The answer to this question further builds on the capability which has been created for the transformation of html from servicenow and Jira - as presented in the servicenow community article

The external script ‘HtmlToWiki’, which can be found on our public git repo (here) including the necessary installation instructions.

Check out following demo about the capabilities.


Comments:

Charlie Schonken commented on 22 March 2021

when I apply

   // Handle Ticket Description
   import com.exalate.transform.HtmlToWiki
     HtmlToWiki htw   = new HtmlToWiki()
     
   issue.description  = htw.transform(replica.description)

… exelate refuses to publish saying

Charlie Schonken commented on 22 March 2021

Assuming this is because I am on JIRA Cloud (not on-premise)

Francis Martens (Exalate) commented on 22 March 2021

Jira Cloud is using markdown.
There are methods to convert from html to markdown

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.