Forums

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

Jira Rest API transforming "1." "2." into #

Glenn April 17, 2020

Am I doing something wrong?

curl -D- -u user:password -X GET -H "Content-Type: application/json" 'https://myserver/rest/api/2/search?jql=project=ABC%20AND%20issueType=story&fields=description&maxResults=2'

 

If the description field contains 1. 2. .... the output in Rest shows #

1.  My first point

2. My second point

becomes 

{"description":"# My first point\r\n # My second point\r\n"}

1 answer

1 accepted

0 votes
Answer accepted
Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2020
Glenn April 20, 2020

I see, Jira is storing content as markdown but the GUI expands the codes to the formatting as you sent.  Great answer!

Like Randy likes this
Randy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 20, 2020

Yup.  You can also get both the markdown and rendered versions from the API when retrieving.  This is a good thing!

Glenn April 20, 2020

How do you get rendered through REST?

Glenn April 20, 2020

Nvm, now that you said the term I knew what to look for.

 

&expand=issues.renderedFields

 

Thanks again!

Like Randy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events