Friday, 1 June 2018

Python: Parse JIRA comments to HTML

Hi Guys, this article is to render JIRA comments into html form. For this JIRA provides one REST API to get things done. Python code is as follow:


import requests
from requests.auth import HTTPBasicAuth


headers = {'content-type': 'application/json'}

response = requests.post(
        'https://jira.xxxx.com/rest/api/1.0/render',
         verify=False,
         data='{"rendererType":"atlassian-wiki-renderer","unrenderedMarkup":"*Hello World*"}',
         headers=headers,
         auth=HTTPBasicAuth('username','password')

)

and response will be

<p><b>Hello World</b></p>

Postman Screenshots:





Thanks!!!!!!!!!! Enjoy Programming!!! :)