jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

feat: allow custom key mappings for the list of issues

Open martinpovolny opened this issue 2 years ago • 4 comments

With this, you can define custom keys and actions in the list of issues.

Example configuration (~/.config/.jira/.config.yml):

...
login: rhn-engineering-mpovolny
project:
  key: OSDEV
  type: ""
server: https://issues.redhat.com
custom_keys:
  issues:
    w: "jira issue view %KEY%"
    t: "&jira issue move %KEY% 'In Progress'; jira issue assign %KEY% rhn-engineering-mpovolny"
    s: '&jira sprint add $(jira sprint list --table --plain --no-headers --columns ID | head -1) %KEY%'
  • The "w" key is an example of a foreground running command mapped to the "w" key. It has no use, but a demo.
  • The "t" key implements a "take" action -- the issue is moved to "In Progress" and then assigned to me. This is run in a separate goroutine (because of the & at the beginning of the command line).
  • The "s" key puts the issue into the latest sprint.

This is just an example, this feature allows everyone to set his/her own mapping.

~~This MR needs rebasing, but I'd like to open a discussion about the feature and the implementation~~

martinpovolny avatar Dec 03 '22 09:12 martinpovolny

Not sure if this would be the best way to add custom keys but it looks interesting. Let me play around a bit with this. Could you please resolve the conflicts and rebase. Thank you!

ankitpokhrel avatar Dec 10 '22 10:12 ankitpokhrel

Rebased.

martinpovolny avatar Dec 10 '22 18:12 martinpovolny

One additional suggestion: It'd be great if this supported overriding the existing keybinds too - e.g. I'd prefer on jira issue list open the issue in the terminal and I'd define a bind like O or some such to open the issue in my browser.

prateek avatar Jan 29 '23 01:01 prateek

One additional suggestion: It'd be great if this supported overriding the existing keybinds too - e.g. I'd prefer on jira issue list open the issue in the terminal and I'd define a bind like O or some such to open the issue in my browser.

Came here to say this I want ctrl-k to be y/Y

I don't mind helping at all

conrad760 avatar Apr 10 '24 22:04 conrad760