Hi @Nir Haimov
Can you please help me that how to convert from HTML into JIRA format using C# or javascript?
Hello @Nir Haimov
I am using the html-2-jira-markup nuget package manager. But facing the problem with ul, ol tag. Can you please suggest is there way to resolve this.
Please share the HTML string you are trying to convert and the output converted string you get
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Nir Haimov
Html String
<b>From</b>: Test \\\\<b>To</b>: Test \\\\<b>Subject</b>: Test for Bullet points \\\\<b>Email Body</b>: <p>Hello,</p><p> </p><p>This is a<strong> test email.</strong></p><ul><li>test</li><li>test</li></ul><p><strong>checking below:</strong></p><ol><li>test</li><li>test</li></ol><p>Thank you,</p><p> </p><p><strong>Test </strong><i>Test<strong> </strong>Test</i></p><p>Test</p>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Milind Suresh Nikam and what string you get when you try to convert this?
Also, why you have multiple \\\\ in your HTML string?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Nir Haimov
I am using this for commenting email subject and body into jira comment. so after subject i want new line so i have added \\
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are all welcome to follow up this article on this subject
https://community.atlassian.com/t5/Jira-articles/Convert-HTML-to-Jira-WikiMarkup/ba-p/1781055#M5257
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, this does not work for me:
original string :
<p>Le prix total d'un computer ne peux jamais dépasser 1000 $<br />
Le contrôle est effectué sur la page caddie.</p>
after using Jira markup Html2JiraMarkup, here is the converted string :
\ \Le prix total d'un computer ne peux jamais dépasser 1000 $<br />\Le contrôle est effectué sur la page caddie.\
REST Error 400
After doing this :
private static string CleanStringDescription(string str)
{
string s = HttpUtility.HtmlDecode(str);
string cleanStr;
cleanStr = Regex.Replace(s, @"\n", "");
cleanStr = Regex.Replace(cleanStr, @"\r", "");
cleanStr = Regex.Replace(cleanStr, @"\t", "");
cleanStr = Regex.Replace(cleanStr, @"<p>", "");
cleanStr = Regex.Replace(cleanStr, @"</p>", "");
cleanStr = Regex.Replace(cleanStr, @"<br />", "");
return cleanStr;
}
It works !
Le prix total d'un computer ne peux jamais dépasser 1000 $Le contrôle est effectué sur la page caddie.
I hope this help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
except for the <br /> that i will fix, there is nothing to do with Html2JiraMarkup to "REST Error 400"
If the API fails for you that because something you are not doing right.
In worst case, Html2JiraMarkup will convert partial of the HTML string but the still the string will be post to Jira, even if you just send HTML as is to Jira, it will post it, and you will see all the HTML tags in your Jira field, so in any case this should not fail in API, unless you are doing something wrong, and it's not related to the conversion of the HTML string
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you are right.
i edit the post to share the way i fixed the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I updated the Html2JiraMarkup package, so now your <br /> will be changed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i edit the post to share the way i fixed the issue.
The string is taken from the debugger on local (text format), just after the use of the lib,
and finaly, got a rest error with the wrong string.
The only way i found is to use the HttpUtility shipped with .Net framework.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nir Haimov
can you please try to create and publish for .Net Core so that would be great as of now .Net core is more usable than standard one and thank you so much for looking into this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kapil Soni
I will try to to create something, but can't promise anything, i might be able to create a solution only for part of the conversion from HTML to Jira and not all of it.
I will do my best and keep you update
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nir Haimov
Thank you so much for quick prompt and its enough for all of us to convert HTML to Jira. Meanwhile day after will post my solution here which covers around 95% HTML to Jira convert using javascript/jQuery.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kapil Soni @faisalamdani @Michael Cowan @Noah Povis
I create a nuget package:
https://www.nuget.org/packages/Html2JiraMarkup/
you are welcome to download and use it.
No need to mention i tested it and it works for me, but i didn't tested all use cases, so let me know if something not converting well
Once you confirm it works fine, i will post an article so anyone who will search for the same solution will find it easily.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nir Haimov
Thank you so much and I will surely look into and let you know if I encounter any bug.
kapil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Nir Haimov
I am working on angular how I will use this package?
Or there is any other npm package?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This package is for C#, it's not a npm package.
Angular is your front-end... if you are using C# in your backend you can use this package.
What is your backend?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nir Haimov
Will provide you update here by End of this week. Due to some project related urgency i wouldn't got chance but for sure by end of this week will validate this and keep you posted here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No,
But when i will get time, i will create npm package so it will be available for you too
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am REALLY confused how Jira has not provided a simple SDK or tool to convert HTML into the Jira Markup for use with the REST API. Does everyone have to painfully map HTML tags to markup blocks?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah i agree this is ridiculous
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Michael Cowan @Kapil Soni I am also facing the same issue.
there is one npm module is present though its not converting it properly but you can give it a try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.