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

Losing Newline character when creating customer request through Jira API?

Daniel Pohl December 2, 2022

We are using the "Create customer request" Jira Service Desk API (POST /rest/servicedeskapi/request) to create Jira Service Desk tickets.

How can we include a newline character (e.g. \n) within any of the textual parameters like "description"?

We've tried many variations of \n but nothing seems to work.  The ticket just gets created with the plain text.

Note that we have disabled HTML in our Jira Service Desk for security reasons.

2 answers

1 accepted

4 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2022

Hi @Daniel Pohl - Have you tried using markdown?

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. \\ Habitant morbi tristique senectus et netus et malesuada. Feugiat nisl pretium fusce id velit ut tortor pretium. Sed euismod nisi porta lorem.
Daniel Pohl December 2, 2022

Yes, we tried \\ but it just renders the plain text with 2 backslashes.

Looks like Atlassian Community does the same thing!

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 2, 2022

There are limitations with the portal experience.  Have you considered maybe going the route of creating an issue via the Jira API rather than a customer request via the JSM API?  You may get a little more leeway on it.

Note - I believe there are issues with setting the Request Type field during the create issue call so you may have to create the issue and then set the Request Type as a second edit issue call immediately after the issue is created.  I know it's clunky, but it may remove some of the constraints you'll face with the JSM API.

Daniel Pohl December 4, 2022

Actually, it looks like \\ does in fact create the newline through the ServiceDesk API.  Looks like we were making a mistake in our post that was messing things up.

Like Mark Segall likes this
0 votes
Daniel Pohl December 4, 2022

Actually, it looks like \\ does in fact create the newline through the ServiceDesk API.  Looks like we were making a mistake in our post that was messing things up.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events