Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Allow setting timestamps when creating issues and comments #7895

Open
3 of 7 tasks
argv-minus-one opened this issue Aug 17, 2019 · 3 comments
Open
3 of 7 tasks
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@argv-minus-one
Copy link

  • Gitea version: 1.9.0
  • Git version: 2.20.1
  • Operating system: Debian Linux amd64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant

Description

Please consider allowing repository owners to create back-dated issues and issue comments (that is, issues/comments with specific timestamps that are in the past) via the API. As with #7790, this is needed to import issues from other issue trackers using an external tool.

API fields affected

According to Swagger, the API endpoints and fields in question are:

  • POST /api/v1/repos/{owner}/{repo}/issues
    • closed_at
    • created_at
  • POST /api/v1/repos/{owner}/{repo}/issues/{index}/comments
    • created_at
    • updated_at

Workaround

As with #7790, the desired timestamps can be set directly in the database instead.

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Aug 17, 2019
@argv-minus-one
Copy link
Author

/api/v1/repos/{owner}/{repo}/milestones also has the read-only timestamp field closed_at.

@r10r
Copy link

r10r commented Jul 30, 2021

Hi there, I've the same issue. We want to migrate from redmine to gitea and don't want to loose the original dates for issues and comments.

@lunny Is it possible to make the timestamp files read-write for the API (at least for the time of the migration) ?

@hakito
Copy link
Contributor

hakito commented May 24, 2023

I am also working on a migration from JIRA using the API. But it is currently not possible to preserve the timestamps via the API. (My workaround is to set the timestamps via a shell script which is quite tricky for docker containers)

But I'd suggest to add a parameter like sudo to override the current time. So it would be available for ALL api calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

4 participants