Forums

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

What document format should be used to create comments with attachments?

Melvin Corbes June 15, 2023

I'm currently working on replicating JIRA's functionality in Salesforce where users can comment and attach files. In JIRA, when attaching a file to a comment, the file must first be uploaded. I'm wondering if the same workflow is achievable when using the JIRA REST API in Salesforce.

Thus far, my research has led me to separate API calls for adding comments and attaching files, but I haven't found a method that combines both actions into a single operation. Can anyone provide insight or direct me to a resource that could assist with implementing this feature? What document format should be used to create comments with attachments?

 

1 answer

0 votes
Graham Twine
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.
June 18, 2023

Hello @Melvin Corbes ,

 

Is your question related to Salesforce or Jira?

If Salesforce you will get better answers from the Salesforce community.

 

If Jira, cloud DC or server?

This is done in two steps.

1. Upload file

2. Add comment. The comment can reference an attachment in the issue.

 

Remember there are configurations about what a server will accept in attachments. eg amount of attachments and size.

 

How are you 'replicating' this? The responsibility falls on the author of the functionality to decide how to implement the API provided by the vendor in this case the Atlassian REST documentation is quite useful. Make sure you are reading the documentation for the version of the application you are integrating into.

Melvin Corbes June 27, 2023

commentwithfiles.png

 

 

Hello @Graham Twine  the above screenshot is what I want to achieve using the REST API

"body": {
"version": 1,
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Comment with files"
}
]
},
{
"type": "mediaGroup",
"content": [
{
"type": "media",
"attrs": {
"id": "49ae84a6-dc23-4d03-96e9-5b6eaafb9b10",
"type": "file",
"collection": ""
}
}
]
},
{
"type": "paragraph",
"content": []
}
]
}

I encountered an error with the message "Bad Request {"errorMessages":["INVALID_INPUT"],"errors":{}}".

I believe the issue lies with the JSON format that I used.  I would greatly appreciate your guidance in providing the correct format for achieving my goal.

Suggest an answer

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

Atlassian Community Events