LoginSignup
3
7

More than 5 years have passed since last update.

[Jira][ブックマークレット] Jira向けブックマークレット集

Last updated at Posted at 2017-10-26

Jira で使用する用の地味に便利なブックマークレット集

表示中のページリンクを Jira のコメント記法形式で取得

javascript:(
    function(){
        window.prompt("以下をコピーして下さい","["+document.title.replace('|','|')+"|"+location.href+"]");
    }
)();

現在表示している Jiraページ の Issue ID を取得

HOGE-123 のような課題のキーを取得する。
Gitのブランチやコミットログに記載するなど用。

対応ページは以下

  • 課題表示画面
  • 課題一覧表示画面
  • 「バックログ」で選択中の課題
  • 「アクティブなスプリント」で選択中の課題
javascript: (
    function () {
        var url = location.href;
        var issueID;
        /* Jira Software RapidView (バックログ, アクティブなスプリント) */
        issueID = url.match(/selectedIssue=(.+-[0-9]+)/);
        if (issueID != null && issueID.length > 1) {
            window.prompt("以下をコピーして下さい", issueID[1]);
            return;
        }
        /* 課題表示画面 */
        issueID = url.match(/browse\/(.+-[0-9]+)/);
        if (issueID != null && issueID.length > 1) {
            window.prompt("以下をコピーして下さい", issueID[1]);
            return;
        }
        /* 課題一覧表示画面 */
        issueID = url.match(/issues\/(.+-[0-9]+)/);
        if (issueID != null && issueID.length > 1) {
            window.prompt("以下をコピーして下さい", issueID[1]);
            return;
        }
    }
)();
3
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
7