Last active
March 26, 2021 00:31
-
-
Save smellymonk/697d3157cfea78ee552c114ac6fe044b to your computer and use it in GitHub Desktop.
Get Jira Sprint Ticket Descriptions
This file contains hidden or 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
var issues = $('.ghx-issues')[0] | |
var getData = (issues, selectors) => { | |
return selectors.map(([sel, name, getter]) => { | |
return Array.from(issues.querySelectorAll(sel)).map(item => ({ | |
[name]: getter ? item[getter] : item.innerText | |
})) | |
}).reduce((items, next) => items.map((item, j) => ({...item, ...next[j]}))) | |
} | |
var result = getData(issues, [['.ghx-summary', 'title'], ['.ghx-key', 'ticket'], ['.ghx-type', 'type', 'title']]) | |
var list = result | |
.filter(({title}) => !title.startsWith('SPIKE')) | |
.map(({title, ticket, type}) => `${ticket} (${type}): ${title}`) | |
var text = list.join('\n') | |
copy(text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment