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.
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>
}
]
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.