Skip to content

Instantly share code, notes, and snippets.

Created April 13, 2023 17:51
What would you like to do?
Redirects ZenHub links to GitHub Issues
// ==UserScript==
// @name ZenHub to GitHub Redirect
// @namespace
// @include *://*
// @grant none
// @run-at document-start
// ==/UserScript==
(() => {
const regex = /https:\/\/app\.zenhub\.com\/workspaces\/.+\/issues\/gh\/(.+\/.+?)\/(\d+)$/;
const input = window.location.href;
const match = input.match(regex);
if (match) {
const orgRepo = match[1];
const issueNumber = match[2];
console.log("oRepo:" +orgRepo);
console.log("i#:" + issueNumber)
const url = `${orgRepo}/issues/${issueNumber}`;
Copy link

For Userscripts in Safari. May work in Tampermonkey or other user script extensions in Chrome/FF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment