Files
notes/_ARCHIVE/02_work_tickets.md
2026-07-14 08:05:36 -07:00

93 lines
2.2 KiB
Markdown

---
obsidianUIMode: preview
---
```button
name Open New Ticket
type command
action Templater: Create templates/TPL_ticket.md
```
### Backlog
```dataviewjs
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
```dataviewjs
// 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
```dataviewjs
// 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
```dataviewjs
// 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.
```