Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brenopolanski/new-gitlab-issue-url
Generate a URL for opening a new GitLab issue with prefilled title, description, and other fields
https://github.com/brenopolanski/new-gitlab-issue-url
gitlab gitlab-issues npm-package url
Last synced: about 1 month ago
JSON representation
Generate a URL for opening a new GitLab issue with prefilled title, description, and other fields
- Host: GitHub
- URL: https://github.com/brenopolanski/new-gitlab-issue-url
- Owner: brenopolanski
- License: mit
- Created: 2019-12-05T14:47:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-11T18:06:54.000Z (about 5 years ago)
- Last Synced: 2024-10-12T01:40:44.660Z (3 months ago)
- Topics: gitlab, gitlab-issues, npm-package, url
- Language: JavaScript
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# new-gitlab-issue-url
> 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](https://github.com/sindresorhus/new-github-issue-url)
## Install
**Using NPM:**
```
npm install --save new-gitlab-issue-url
```**Using Yarn:**
```
yarn add new-gitlab-issue-url
```## Usage
```js
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](https://gitlab.com/brenopolanski/hello-world/issues/new?issue[title]=Hi&issue[description]=%0A%0A%0A---%0AI%27m+a+human.+Please+be+nice.)
*(Don't click the "Submit issue" button!)*## API
### newGitlabIssueUrl(options)
Returns a URL string.
#### options
Type: `object`
You are required to either specify the `repoUrl` option or both the `user` and `repo` options.
##### repoUrl
Type: `string`
The full URL to the repo.
##### user
Type: `string`
GitLab username or organization.
##### repo
Type: `string`
GitLab repo.
##### title
Type: `string`
The issue title.
##### description
Type: `string`
The issue description.
##### template
Type: `string`
Use an [issue template](https://gitlab.com/help/user/project/description_templates#description-templates).
For example, if you want to use a template at `.gitlab/issue_templates/Bug.md`, you would specify `Bug` here.
## License
[MIT License](https://brenopolanski.mit-license.org) © Breno Polanski