From db9e6f9f48d617563196a65a5c692dfdcabeda54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Vr=C3=A1na?= <131545+vrana@noreply.gitea.com> Date: Sat, 17 Oct 2026 21:56:31 +0000 Subject: [PATCH] docs: document pre-filling issues and pull requests from query parameters (#592) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Describe the query parameters of the new issue and pull request pages, including those added in https://github.com/go-gitea/gitea/pull/39804. --------- Co-authored-by: Jakub Vrana Reviewed-on: https://gitea.com/gitea/docs/pulls/592 Reviewed-by: wxiaoguang <29147+wxiaoguang@noreply.gitea.com> Reviewed-by: bircni Co-authored-by: Jakub Vrána <131545+vrana@noreply.gitea.com> --- .../issue-pull-request-templates.md | 2 +- .../prefill-issues-pull-requests.md | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 docs/usage/issues-prs/prefill-issues-pull-requests.md diff --git a/docs/usage/issues-prs/issue-pull-request-templates.md b/docs/usage/issues-prs/issue-pull-request-templates.md index 94fa0b30..3d785691 100644 --- a/docs/usage/issues-prs/issue-pull-request-templates.md +++ b/docs/usage/issues-prs/issue-pull-request-templates.md @@ -15,7 +15,7 @@ creating issues and pull requests. This will cut down on the initial back and fo of getting some clarifying details. It is currently not possible to provide generic issue/pull-request templates globally. -Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one. +Additionally, the New Issue page URL can be suffixed with `?title=Issue+Title&body=Issue+Text` and the form will be populated with those strings. Those strings will be used instead of the template if there is one. See [Pre-filling Issues and Pull Requests](prefill-issues-pull-requests.md) for all parameters. ## File names diff --git a/docs/usage/issues-prs/prefill-issues-pull-requests.md b/docs/usage/issues-prs/prefill-issues-pull-requests.md new file mode 100644 index 00000000..826549ac --- /dev/null +++ b/docs/usage/issues-prs/prefill-issues-pull-requests.md @@ -0,0 +1,42 @@ +--- +date: "2026-10-17T00:00:00+00:00" +slug: "prefill-issues-pull-requests" +sidebar_position: 14 +--- + +# Pre-filling Issues and Pull Requests + +Links to the pages for creating issues and pull requests can pre-fill the form with query parameters. +This lets you link users from another app, a README or a project board to a form that is already categorized. + +- New issue: `/{owner}/{repo}/issues/new?…` +- New pull request: `/{owner}/{repo}/compare/{base}...{head}?…` + +For example, this link opens a new issue with a title, two labels and an assignee: + +``` +https://gitea.example.com/owner/repo/issues/new?title=Dashboard+crashes&label=kind/bug,area/dashboard&assignee=alice +``` + +## Parameters + +| Parameter | Value | +| ------------- | --------------------------------------------------------------------------- | +| `title` | Title | +| `body` | Description | +| `label` | Comma-separated label IDs or names | +| `labels` | Alias of `label` | +| `milestone` | Milestone ID or name | +| `project` | Comma-separated project IDs or titles | +| `assignee` | Comma-separated user IDs or usernames | +| `template` | File name of the [template](issue-pull-request-templates.md) to use | +| `field:` | Value of the field with this `id` in a YAML template | + +IDs and names can be mixed and names are matched case-insensitively. Values that don't match anything in the repository are ignored. +Labels include the organization's labels, and closed milestones and projects can be selected too. +Milestones and projects are only offered to users who can write to issues or pull requests, so for other users these parameters have no effect. + +The values from the link take precedence over the title, description, labels and assignees of the template. + +When there are several issue templates to choose from, the parameters are passed through to the chosen one. +On the compare page, any of these parameters also opens the pull request form directly, as `expand=1` does.