The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Use html-code in Issue

Carsten Stepan
Contributor
March 26, 2024

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Carsten Stepan
Contributor
March 26, 2024

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

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events