Forums

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

Use html-code in Issue

Carsten Stepan
Contributor
March 26, 2024 edited

I'am in the task of migrating some tickets from our old system to Jira. In the old one we have plenty of HTML-code. When I retrieve the issues from that server, I get a descriotion similar to this for instance:

\n\tHallo Welt

 When I manually create a new issue in my board containing that description, everything works foine (despite the text not being formated, as the parser can't interoret HTML-markdown, apparently). 

 

However when doing this using the REST-API, I get an HTTP (Bad Request)-response:

 

var description = "\n\tHallo Welt";

var data = $@"{{
""fields"": {{
""project"":
{{
""id"": 1234
}},
""summary"": ""MyTitle"",
""description"": ""{ description }"",
""issuetype"": {{
""name"": ""Bug""
}}
}}
}}";
var content = new StringContent(data, Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync($" { host }/issue", content);
var responseText = await response.Content.ReadAsStringAsync();

 I also tried to convert the HTML to markdown. However markdown-support also seems pretty limited in JIRA.

1 answer

1 accepted

1 vote
Answer accepted
Carsten Stepan
Contributor
March 26, 2024 edited

Oooooutsh, that hurts.. had to escape the linebreaks \n with \\n and the tabs \t with \\t in the `description`. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events