I am writing a custom Service Desk portal for my organization.
I am using the jira REST API (with Basic "token" auth) to query issues/issue comments (with JQL) on a server. In general, this is working okay since the issue and issue/<key>/comment endpoints return a renderedBody field with the HTML. I can display the HTML on the webpage without requiring an ADF renderer.
The issue is how can we go the other way? For example, I want users to be able to create tickets from my custom Service Desk webpage. From what I can tell, there's two options:
1. Use REST API v2: https://airps.atlassian.net/rest/api/2/issue/<key>/comment
The body field takes a string. Seems like I can't post any rich HTML text at all so that's probably no good.
2. Use REST API v3: https://airps.atlassian.net/rest/api/3/issue/<key>/comment
The body field takes an ADF object.
I can post to that endpoint:
{ version: 1, type: 'doc', content: [ { type: 'paragraph', content: [ { type: 'text', text: 'test internal' } ] } ] }
How can I embed images and files in a comment? Could I first create an attachment on the issue, get the link, and post it as a mediaSingle node type as follows?
version: 1, type: 'doc', content: [ { "type": "mediaSingle", "content": [ { "type": "media", "attrs": { "type": "external", "url": "http://some-jira-url", "width": 710, "height": 163, } } ] } ]
What are my options for Editors? I need to choose an editor that can output the user's comment to ADF. This is assuming the image/files issue above can be solved.
This whole thing feels hacky to be honest. Am I going about this the wrong way? What is the best way to create my own support webpage (support.mycompany.com)? We want to control the entire experience and integrate our own auth system (that's why we're not interested in building a Connect/Forge app)
Thanks,
Will