Generate a URL for opening a new GitLab issue with prefilled title, description, and other fields
GitLab supports prefilling a new issue by setting certain search parameters. This package simplifies generating such URL.
Inspired by @sindresorhus new-github-issue-url
Using NPM:
npm install --save new-gitlab-issue-url
Using Yarn:
yarn add new-gitlab-issue-url
const newGitlabIssueUrl = require('new-gitlab-issue-url');
const url = newGitlabIssueUrl({
user: 'brenopolanski',
repo: 'hello-world',
title: 'Hi',
description: '\n\n\n---\nI\'m a human. Please be nice.'
});
//=> 'https://gitlab.com/brenopolanski/hello-world/issues/new?issue[title]=Hi&issue[description]=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.'
Try the URL
(Don't click the "Submit issue" button!)
Returns a URL string.
Type: object
You are required to either specify the repoUrl
option or both the user
and repo
options.
Type: string
The full URL to the repo.
Type: string
GitLab username or organization.
Type: string
GitLab repo.
Type: string
The issue title.
Type: string
The issue description.
Type: string
Use an issue template.
For example, if you want to use a template at .gitlab/issue_templates/Bug.md
, you would specify Bug
here.
MIT License © Breno Polanski