Skip to content

Commit 30c6b7f

Browse files
committed
feat: view parent task
1 parent 588d79c commit 30c6b7f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lua/jira/board/init.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ function M.setup_keymaps()
215215
vim.keymap.set("n", "go", function()
216216
require("jira.board").show_child_issues()
217217
end, opts)
218+
vim.keymap.set("n", "gp", function()
219+
require("jira.board").show_parent_issue()
220+
end, opts)
218221
end
219222

220223
function M.load_view(project_key, view_name)
@@ -597,6 +600,18 @@ function M.show_child_issues()
597600
M.load_view(state.project_key, "JQL")
598601
end
599602

603+
function M.show_parent_issue()
604+
local node = helper.get_node_at_cursor()
605+
if not node or not node.parent then
606+
vim.notify("Issue does not have a parent or parent not found.", vim.log.levels.WARN)
607+
return
608+
end
609+
610+
state.custom_jql = string.format('key = "%s" OR parent = "%s"', node.parent, node.parent)
611+
state.current_query = "Parent & Children of " .. node.parent
612+
M.load_view(state.project_key, "JQL")
613+
end
614+
600615
function M.open(project_key)
601616
-- If already open, just focus
602617
if state.win and api.nvim_win_is_valid(state.win) then

lua/jira/board/render.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ function M.render_help(view)
412412
{ k = "gw", d = "Add time" },
413413
{ k = "gb", d = "Checkout/Create Branch" },
414414
{ k = "go", d = "Show Child Issues (Sub-tasks)" },
415+
{ k = "gp", d = "View Parent & Children (JQL)" },
415416
}
416417

417418
local lines = { "" }

0 commit comments

Comments
 (0)