Last active
October 2, 2023 16:14
-
-
Save oneeyedman/c138c6368697593736f69e5b39cdc46a 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
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(); |
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
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