Skip to content

Instantly share code, notes, and snippets.

@oneeyedman
Last active October 2, 2023 16:14
Show Gist options
  • Save oneeyedman/c138c6368697593736f69e5b39cdc46a to your computer and use it in GitHub Desktop.
Save oneeyedman/c138c6368697593736f69e5b39cdc46a to your computer and use it in GitHub Desktop.
function getList(selector) {
return [...document.querySelectorAll(selector)].map(item => item.textContent.trim());
}
function getSubtasks() {
const SELECTORS = {
key: '.issuekey',
tasks: '.stsummary'
};
const ARROW = '→';
const keys = getList(SELECTORS.key);
const tasks = getList(SELECTORS.tasks);
const result = [];
for (let i = 0; i< keys.length; i++) {
result.push(`${keys[i]} ${ARROW} ${tasks[i]}`);
}
console.log(result.join('\n'))
}
getSubtasks();
function showPendingSubTasks() {
const subTasks = document.querySelectorAll('.issuerow');
subTasks.forEach(task => {
const tag = task.querySelector('.jira-issue-status-lozenge');
if (tag.textContent.toLowerCase().trim() !== 'backlog') {
tag.style.backgroundColor = '#2684ff';
tag.style.color = '#fff';
} else {
tag.style.color = null;
tag.style.backgroundColor = null;
}
});
console.log(subTasks.length)
}
showPendingSubTasks();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment