You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am working on jira V3. When we get the jira issue from api we get the issue desciption in ADF format (I think) how to convert that format into HTML to show in our UI or there is any specific editor is given.
Thank You!
Hello @faisalamdani ,
If I understand correctly you are calling the /rest/api/3/issue/{issueIdOrKey} REST API endpoint and you are looking for a way to get the issue description in HTML.
Now, if my understanding is correct (provide more details otherwise), then all you have to do is to append the argument to expand the rendered fields to your REST API call, like in below example:
https://NAME.atlassian.net/rest/api/3/issue/{ISSUE-KEY_OR_ID}?expand=renderedFields
This way you will get the HTML for the text in the issue description.
For more details on expansion and for known issues, you may want to review the below links:
I hope this helps.
Cheers,
Dario
Hey @Dario B - this endpoint (https://api.atlassian.com/pf-editor-service) seems to be down. We're getting back a 404 not found.
Is this a known issue? Hope it comes back online - we found it super valuable and were using it in prod
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's not an official endpoint and indeed it is not documented anywhere. Therefore it should not be used since it could change or stop working from one day to another without previous notice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it. Would it be possible to open source the code for the convertor? It was super helpful to our team and users
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dario B ,
Thanks you for your answer.
I would like to join @Aravindh Dorai 's request - even though `pf-editor-service` wasn't an official service, it is very useful to developers to integrate with, and write services on top of the great Jira platform. Do you think you will be able to provide an open source library for the convertor?
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to get in touch with the team in charge of this endpoint and until that time I cannot say much.
However, our internal team did a little investigation and they noticed that the service name changed and the endpoint still works internally. However, it cannot be accessed via api.atlassian.com anymore. Not sure if this is intended or not. I will provide an update as soon as I will manage to get more information on this.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have created a Feature Request to have a public REST API endpoint to convert among formats:
You may want to vote and watch the above feature request so that you will get notified in case of any update. The feature will be addressed according to the Implementation of New Features Policy
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> That's not an official endpoint and indeed it is not documented anywhere.
It's used at least in one of the apps in the bitbucket atlassian repository :
(that's what convince me to use it in the first place some times ago).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Maxime de Roucy ,
Welcome to the Atlassian Community.
Please notice that:
Once this has been said, I am happy to let you know that a slightly outdated version of the code is available in the public atlaskit repo:
You can give it a try since, for now, it is not granted that an official endpoint will be released.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario B it seems like the link you provided to the public atlaskit repo converts to the Prosemirror document format vs what we need, which is the Atlassian document format. Maybe I'm missing something? Is there any documentation on how to convert markdown to ADF using that code?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Aravindh Dorai I might not be the best person to answer here since I have never done this myself. However, I forwarded your question to DEV and I got the below example in return:
import { defaultSchema } from '@atlaskit/adf-schema'; import { JSONTransformer } from '@atlaskit/editor-json-transformer'; import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer'; const jsonTransformer = new JSONTransformer(); const markdownTransformer = new MarkdownTransformer(defaultSchema); const markdownDocument = ''; const adfDocument = jsonTransformer.encode(markdownTransformer.parse(markdownDocument));
Can you kindly test this and let me know if this is what you are looking for?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Dario B ! This works going from markdown -> ADF. When I try to do the reverse, I get a "This is not implemented yet" error.
This is the code I'm using
markdownTransformer.encode(jsonTransformer.parse(adfDocument))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That library is old and not maintained and it can pretty much be that the method was not implemented at that time.
As an alternative, you can try to have a look at the below one:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dario B Is there is any end point so we can add out HTML to jira using Jira API. At this time it's show as <h1>heading 1</h1> on jira after posting commit using API.
thanks
Abdul.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @faisalamdani
As an alternative to @Dario B's method, read this recent post Is there documentation for api.atlassian.com/pf-editor-service/convert? that describes an undocumented Atlassian REST API endpoint that converts ADF to HTML, markdown and a few others, and vice-versa. It means double processing of the issue description, but it works.
Apart from that, there are a few other open source Java and C# libraries that apparently do a reasonable job of converting ADF to HTML, but I've not tried any of them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For Python, see my recommendation HERE
for comment in jira.comments(issue.id, expand='renderedBody'): # this is the main trick
print(comment.renderedBody)
The whole process:
from jira import JIRA
jira = JIRA( basic_auth=("<email>", "<API_KEY>"), # a username/password_or_API_KEY server="https://YOUR_ATLASSIAN_SERVER.atlassian.net", options={"rest_api_version": 3} ) # Get an issue. issue = jira.issue("ALL-1234") # A project 'ALL' as example with issue number 1234. avoiding_types = ['app', 'atlassian'] for comment in jira.comments(issue.id, expand='renderedBody'): # this is the main trick print(comment.author.accountType) print(comment.author.displayName) if comment.author.accountType not in avoiding_types: print(comment.author.emailAddress) print(comment.renderedBody) print(comment.created)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.