Skip to content

Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields with Python

Notifications You must be signed in to change notification settings

foss-dev/new-github-issue-url-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields

Inspired by Sindre Sorhus' new-github-issue-url

Usage

from new_github_issue_url_py import IssueUrl

options = {
    "user": 'YOUR_USERNAME',
    "repo": 'YOUR_REPO',
    "title": "The issue title",
    "body": 'The issue body',
}

issue_url = IssueUrl(options)

issue_url.opn()

Try the URL

(Don't click the "Submit new issue" button!)

API

IssueUrl(options)

Gives a dict

options

Type: dict

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

GitHub username or organization.

repo

Type: string

GitHub repo.

repo

Type: string

The issue body.

title

Type: string

The issue title.

template

Type: string

Use an issue template.

For example, if you want to use a template at ISSUE_TEMPLATE/unicorn.md, you would specify unicorn.md here.

labels

Type: string[]

The labels for the issue.

Requires the user to have the permission to add labels.

milestone

Type: string

The milestone for the issue.

Requires the user to have the permission to add labels.

assignee

Type: string

The user to assign to the issue.

Requires the user to have the permission to add labels.

projects

Type: string[]

The projects to add the issue to.

The project reference format is user/<project-number>, for example, if the URL to the project is https://github.com/YOUR_USERNAME/some-repo/projects/3, the project reference would be some-repo/3.

Requires the user to have the permission to add labels.

url

Returns the last URL

Usage: print(issue_url.url)

For example: https://github.com/YOUR_USER/YOUR_REPO/issues/new?title=EXAMPLE+TITLE&body=EXAMPLE%BODY

opn()

Opens the issue URL on the new tab in your default browser.

Usage: issue_url.opn()

About

Generate a URL for opening a new GitHub issue with prefilled title, body, and other fields with Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages