Hello,
when i call the JIRA REST API to create an issue
rest/api/2/issue
i get the responst in JSON format.
when attaching a File to that issue
rest/api/2/issue/xxx/attachments
i get the response in JSON format, but with surrounding "[]"-braces.
why that?
best regards
Lars
Info:
Because that's the expected behaviour, as per the documentation:
POST /rest/api/2/issue/{issueIdOrKey}/attachments
Add one or more attachments to an issue.
Since you can attach 1 or more, the response has be an array of 1 or more objects, which is shown in the example response provided in the documentation:
[
{
"self": "http://www.example.com/jira/rest/api/2.0/attachments/10000",
"filename": "picture.jpg",
<blah blah>,
},
{
"self": "http://www.example.com/jira/rest/api/2.0/attachments/10001",
"filename": "dbeuglog.txt",
<blah blah>
}
]
Hello David,
thank you for the answer, that makes sense..
Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you asking us why we developed an endpoint to return a JSON array instead of what you expect, a JSON object?
We didn't. You're asking us design questions, this is a community, not an atlassian dev hub / coffee room.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.