Skip to content

Instantly share code, notes, and snippets.

@bgmort
Created January 4, 2013 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgmort/4455742 to your computer and use it in GitHub Desktop.
Save bgmort/4455742 to your computer and use it in GitHub Desktop.
User script providing the functionality discussed at https://jira.atlassian.com/browse/JRA-13079. Provides a link from a JIRA issue page to a search page containing the issue's subtasks, where then can be modified in bulk.
// ==UserScript==
// @name Jira: Edit all sub-tasks
// @description Open subtasks of a story in search so they may all be modified at once
// @match http://jira.your.company.com/browse/*
// ==/UserScript==
(function(){
var matches = location.pathname.match(/[A-Z]+-[0-9]+/),
list, id, item, link;
if (matches){
id = matches[0];
list = document.getElementById('subtask-view-options');
if (list) {
link = document.createElement('a');
link.href = '/issues/?jql=parent%20%3D%20' + id,
link.className = 'aui-list-checked aui-list-item-link',
link.title = 'Show and edit subtasks in navigator',
link.innerHTML = 'Edit All';
item = document.createElement('li');
item.className = 'aui-list-item';
list.appendChild(item);
item.appendChild(link);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment