Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dump Jira permission scheme into JSON
JSON.stringify(Object.fromEntries(Array.from(document.querySelectorAll('[data-permission-key]')).map(tr => {
let title = tr.querySelector('[class="title"]').innerText
let types = Object.fromEntries(Array.from(tr.querySelectorAll('[class="types"] dt')).map(dt => {
let sentence = dt.innerText
let next = dt.nextSibling
let values = (next !== null) ? [] : null
while (next !== null && next.tagName == "DD") {
values.push(next.innerText)
next = next.nextSibling
}
return [sentence, values]
}))
return [title, types]
})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.