2.2 KiB
2.2 KiB
obsidianUIMode
| obsidianUIMode |
|---|
| preview |
name Open New Ticket
type command
action Templater: Create templates/TPL_ticket.md
Backlog
const pages = dv.pages("#ticket")
.where(p => p.status === "Backlog" && p.file.tags.includes("#work"));
if (pages.length > 0) {
dv.table(
["Ticket", "Priority", "Project"],
pages
.sort(p => p.priority, 'desc')
.map(p => [p.file.link, p.priority, p.project])
);
}
To Do
// 1. Get the data
const pages = dv.pages("#ticket")
.where(p => p.status === "To Do" && p.file.tags.includes("#work"));
// 2. Check if there are any results
if (pages.length > 0) {
// 3. If there are results, build and render the table.
dv.table(
["Ticket", "Priority", "Project"],
pages
.sort(p => p.priority, 'desc')
.map(p => [
p.file.link,
p.priority,
p.project
])
);
}
// 4. If there are no results, do nothing. The block will render as empty.
In Progress
// 1. Get the data
const pages = dv.pages("#ticket")
.where(p => p.status === "In Progress" && p.file.tags.includes("#work"));
// 2. Check if there are any results
if (pages.length > 0) {
// 3. If there are results, build and render the table.
dv.table(
["Ticket", "Priority", "Project"],
pages
.sort(p => p.priority, 'desc')
.map(p => [
p.file.link,
p.priority,
p.project
])
);
}
// 4. If there are no results, do nothing. The block will render as empty.
Done
// 1. Get the data
const pages = dv.pages("#ticket")
.where(p => p.status === "Done" && p.file.tags.includes("#work"));
// 2. Check if there are any results
if (pages.length > 0) {
// 3. If there are results, build and render the table.
dv.table(
["Ticket", "Priority", "Project"],
pages
.sort(p => p.priority, 'desc')
.map(p => [
p.file.link,
p.priority,
p.project
])
);
}
// 4. If there are no results, do nothing. The block will render as empty.