Skip to content

Instantly share code, notes, and snippets.

@ipatalas
Last active May 1, 2024 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipatalas/ad19a972f221ac68608acf26aa8e2ce0 to your computer and use it in GitHub Desktop.
Save ipatalas/ad19a972f221ac68608acf26aa8e2ce0 to your computer and use it in GitHub Desktop.
JIRA bookmarklets
let urlParams = new URLSearchParams(location.search);
let fromUrl = /\/browse\/(.*)/.exec(location.pathname);
let jiraId;
if (urlParams.has('selectedIssue')) {
jiraId = urlParams.get('selectedIssue');
} else if (fromUrl) {
jiraId = fromUrl[1];
}
if (jiraId) {
navigator.clipboard.writeText(jiraId);
} else {
alert("Couldn't find JIRA ticket ID");
}
@ipatalas
Copy link
Author

Installation:

  1. Go to https://mrcoles.com/bookmarklet/
  2. Paste the code above into the input
  3. Type name you want to have on your bookmarks bar
  4. Click Convert to bookmarklet
  5. Drag and drop generated link (in blue) onto bookmarks bar

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