0

I am trying to post an issue with attachment through Rest API. The issue gets created but the file attachments are not posted.

Please let me know how to solve this.

Below is my request details:

{
"method": "POST",
"transformRequest": [
null
],
"transformResponse": [
null
],
"url": "http://localhost:85/bugtracker/api/rest/issues",
"headers": {
"Authorization": "aWjAGERB07B9kFgkw8mTm-YIMeDdweJ5",
"Content-Type": "application/json",
"Accept": "application/json, text/plain, */*"
},
"data": "{\n \"summary\": \"Sample REST issue-test\",\n \"description\": \"Description for sample REST issue.\",\n \"project\": { \"id\": 215 },\n \"category\": {\"id\": 6},\n \"files\":[\n{\n \"name\":\"test.txt\",\n\"content\":\"dGhpcyBpcyBhIHRlc3QgZmlsZQ0KdGhpcyBpcyB0byB0ZXN0IGF0dGFjaG1lbnRzDQohIyQhQCQhQCQhQCMlI0AhJSNAISUhIyUNCkVuZCBvZiBGaWxl\" \n}\n]\n}",
"timeout": {}
}
2
  • 1
    What is your mantisbt version? – Alexey R. Jul 9 '18 at 16:54
  • Am using MantisBT verison 2.5.1 – Vel Guru Jul 10 '18 at 5:43
1

According to Mantis REST API specification, adding issues with attachments via REST is available since version 2.13.0.

you can see that here https://www.mantisbt.org/bugs/changelog_page.php

Hence, I believe your instance just ignores the request part with files and adds only the issue description. You have to upgrade your Mantis version. The latest one is 2.15.0 currently (10-JUL-2018).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.