Last active
July 28, 2022 13:54
-
-
Save NikFlip/68a2c84f8d2ef2bf73a73953adceeba6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
try { | |
let ticketId = JIRA?.Issue?.getIssueKey(); | |
if (!ticketId) { | |
ticketId = document.querySelector('[name="ajs-issue-key"]')?.getAttribute('content'); | |
} | |
if (!ticketId) { | |
alert('Ticket ID konnte nicht ermittelt werden'); | |
return; | |
} | |
navigator.permissions.query({ name: 'clipboard-write' }).then(result => { | |
if (result.state == 'granted' || result.state == 'prompt') { | |
navigator.clipboard.writeText(ticketId); | |
} | |
}); | |
} catch (e) { console.error(e); alert('Ticket ID konnte nicht ermittelt werden'); } | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment