Issue API and Attachments #1636

Closed
opened 2025-11-02 04:07:53 -06:00 by GiteaMirror · 14 comments
Owner

Originally created by @madman2021 on GitHub (Mar 19, 2018).

  • Gitea version (or commit ref): 1.3.3
  • Git version: n/a
  • Operating system:n/a
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • [x ] MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • [] Yes (provide example URL)
    • No
    • [ a] Not relevant
  • Log gist:

Description

The Issues API doesn't expose attachments, is this by design?
...

Originally created by @madman2021 on GitHub (Mar 19, 2018). - Gitea version (or commit ref): 1.3.3 - Git version: n/a - Operating system:n/a - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [] Yes (provide example URL) - [ ] No - [ a] Not relevant - Log gist: ## Description The Issues API doesn't expose attachments, is this by design? ...
GiteaMirror added the issue/confirmedtype/enhancementmodifies/api labels 2025-11-02 04:07:53 -06:00
Author
Owner

@techknowlogick commented on GitHub (Mar 19, 2018):

@madman2021 could be that no one has coded the functionality yet. For example attachments were just exposed for the releases API endpoint in #3478

@techknowlogick commented on GitHub (Mar 19, 2018): @madman2021 could be that no one has coded the functionality yet. For example attachments were just exposed for the releases API endpoint in #3478
Author
Owner

@lunny commented on GitHub (Mar 29, 2018):

I think this has been resolved by #3478. @madman2021 please confirm that.

@lunny commented on GitHub (Mar 29, 2018): I think this has been resolved by #3478. @madman2021 please confirm that.
Author
Owner

@jonasfranz commented on GitHub (Mar 29, 2018):

@lunny It got only partialy resolved because issues do not provide an assets api.

@jonasfranz commented on GitHub (Mar 29, 2018): @lunny It got only partialy resolved because issues do not provide an assets api.
Author
Owner

@madman2021 commented on GitHub (Apr 26, 2018):

As @JonasFranzDEV mentioned, I was hoping I could insert/get attachments to issues via API calls.

Background

On one of our production sites I have a BugReport button in the corner, this allows the user to enter some text and also press a button to capture a JPEG image of the current webpage, the text would be put into the Issue body and the Image added as an attachment. Currently i'm hosting the image in the production site and the link inserted in the body, idealy it would just be added as an attachment.

Hope that helps understand what I'm talking about.

@madman2021 commented on GitHub (Apr 26, 2018): As @JonasFranzDEV mentioned, I was hoping I could `insert/get` attachments to `issues` via API calls. ### Background On one of our production sites I have a BugReport button in the corner, this allows the user to enter some text and also press a button to capture a JPEG image of the current webpage, the text would be put into the Issue body and the Image added as an attachment. Currently i'm hosting the image in the production site and the link inserted in the body, idealy it would just be added as an attachment. Hope that helps understand what I'm talking about.
Author
Owner

@stale[bot] commented on GitHub (Jan 27, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 27, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@mbedded commented on GitHub (Jul 29, 2019):

I would love to see this issue, too. I am creating issues by an REST-API and the attachments are currently added as links to other sources. Attachments can be set for releases. Is it much work to "just make them public" or do some code have to be written?

I am no go-developer but maybe i would like to take a look if i can implement this feature (had to read the contributions guide, too).

EDIT 2019-09-22:
I invested some days to look into that code. Unfortunately i didn't worked with Go yet and i have many issues to set up my environment. I guess there could be some "go specific" things i have to know. It would be nice if some more "Go aware" people could implement this feature :)

@mbedded commented on GitHub (Jul 29, 2019): I would love to see this issue, too. I am creating issues by an REST-API and the attachments are currently added as links to other sources. Attachments can be set for releases. Is it much work to "just make them public" or do some code have to be written? I am no go-developer but maybe i would like to take a look if i can implement this feature (had to read the contributions guide, too). EDIT 2019-09-22: I invested some days to look into that code. Unfortunately i didn't worked with Go yet and i have many issues to set up my environment. I guess there could be some "go specific" things i have to know. It would be nice if some more "Go aware" people could implement this feature :)
Author
Owner

@bobemoe commented on GitHub (Sep 18, 2019):

I'm looking for this too. Our automated testing scripts post the test results as comments to issue using the Gitea API, and there are some screenshots that I want to attach to the comment.

@bobemoe commented on GitHub (Sep 18, 2019): I'm looking for this too. Our automated testing scripts post the test results as comments to issue using the Gitea API, and there are some screenshots that I want to attach to the comment.
Author
Owner

@bobemoe commented on GitHub (Sep 25, 2019):

Well, I found a silly workaround!! Not sure I'd recommend it though:

I upload the file to a release, using API: /repos/USER/REPO/releases/1/assets

In the response there is a browser_download_url field that contains a link to the image that you can use to embed it into your comment.

PROBLEMS with this: release 1 is not actually associated with the REPO and I don't really know where the files are going! I can't see them on the actual release on the actual repo its associated with, maybe this is a permission issue. I think if the release was associated with the correct repo they may show up. We don't really want them to show up on a release so thats fine, but really messy.

@bobemoe commented on GitHub (Sep 25, 2019): Well, I found a silly workaround!! Not sure I'd recommend it though: I upload the file to a release, using API: /repos/USER/REPO/releases/1/assets In the response there is a `browser_download_url` field that contains a link to the image that you can use to embed it into your comment. PROBLEMS with this: release 1 is not actually associated with the REPO and I don't really know where the files are going! I can't see them on the actual release on the actual repo its associated with, maybe this is a permission issue. I think if the release was associated with the correct repo they may show up. We don't really want them to show up on a release so thats fine, but really messy.
Author
Owner

@guillep2k commented on GitHub (Sep 25, 2019):

Well, I found a silly workaround!! Not sure I'd recommend it though:

I upload the file to a release, using API: /repos/USER/REPO/releases/1/assets

In the response there is a browser_download_url field that contains a link to the image that you can use to embed it into your comment.

PROBLEMS with this: release 1 is not actually associated with the REPO and I don't really know where the files are going! I can't see them on the actual release on the actual repo its associated with, maybe this is a permission issue. I think if the release was associated with the correct repo they may show up. We don't really want them to show up on a release so thats fine, but really messy.

The fact that you can do this is a bug. You should not rely much on it working after a future upgrade.

EDIT: I see that you've already reported it in #8282

@guillep2k commented on GitHub (Sep 25, 2019): > > > Well, I found a silly workaround!! Not sure I'd recommend it though: > > I upload the file to a release, using API: /repos/USER/REPO/releases/1/assets > > In the response there is a `browser_download_url` field that contains a link to the image that you can use to embed it into your comment. > > PROBLEMS with this: release 1 is not actually associated with the REPO and I don't really know where the files are going! I can't see them on the actual release on the actual repo its associated with, maybe this is a permission issue. I think if the release was associated with the correct repo they may show up. We don't really want them to show up on a release so thats fine, but really messy. The fact that you can do this is a bug. You should not rely much on it working after a future upgrade. EDIT: I see that you've already reported it in #8282
Author
Owner

@6543 commented on GitHub (Sep 25, 2019):

GitNex require a API to manage attachments too ... so I'm linking this issue to here: https://gitea.com/mmarif/GitNex/issues/56

@6543 commented on GitHub (Sep 25, 2019): GitNex require a API to manage attachments too ... so I'm linking this issue to here: https://gitea.com/mmarif/GitNex/issues/56
Author
Owner

@lordyavin commented on GitHub (Dec 12, 2019):

Need the endpoints

  • repos/:owner/:repo/issues/:id/assets
  • repos/:owner/:repo/issues/:id/comments/:id/assets

and the issue/comment model should have an attribute that tells me if there are assets.

@lordyavin commented on GitHub (Dec 12, 2019): Need the endpoints * [ ] repos/:owner/:repo/issues/:id/assets * [ ] repos/:owner/:repo/issues/:id/comments/:id/assets and the issue/comment model should have an attribute that tells me if there are assets.
Author
Owner

@andrebruch commented on GitHub (Feb 7, 2021):

I have added the feature in #14601.

@andrebruch commented on GitHub (Feb 7, 2021): I have added the feature in #14601.
Author
Owner

@lordyavin commented on GitHub (Feb 7, 2021):

I have added the feature in #14601.

Too late 😀 I don't use gitea anymore.

@lordyavin commented on GitHub (Feb 7, 2021): > I have added the feature in #14601. Too late 😀 I don't use gitea anymore.
Author
Owner

@nedvedad commented on GitHub (Feb 8, 2021):

I have added the feature in #14601.

cool, much appreciated

@nedvedad commented on GitHub (Feb 8, 2021): > I have added the feature in #14601. cool, much appreciated
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1636