Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events