Draft: tissues - Create issues from templates via glab
Please see README file committed as part of this MR for a detailed explanation of this tool.
This aims to provide an easy CLI wizard for creating issues from templates. Projects that are displayed in the wizard are configurable in the YAML file. Authentication and API interactions rely on glab
, as explained in the README.
Currently, creating issues from templates via API requires:
- Get the issue template content via API
- Use the issue template content as the
description
field in a new issue
This tool aims to make creating issues from templates as easy as making some selections from a prompt and entering a title. Presently, the configuration file contains default title prefixes for projects. This may end up being configurable by template.
EDIT:
Based on an issue I raised for glab
, it seems that glab issue create
would be able to simplify this script significantly.
gitlab-org/cli#1205 (comment 1251490064)
glab issue create
just needs the following resolved for this to happen:
- Ability to use issue templates from arbitrary repository specified using
-R
: gitlab-org/cli#798 - Ability to specify template name in non-interactive mode via a CLI command option: gitlab-org/cli#1153 (comment 1251496604)
EDIT 2:
It seems like glab
aliases could do this job very well. For example, I set the following aliases in glab
:
$ glab alias set glic_sp 'issue create -R "gitlab-com/support/support-pairing" --web -t "Pairing Session - " -a me -d ""'
- Adding alias for glic_sp: issue create -R "gitlab-com/support/support-pairing" --web -t "Pairing Session - " -a me -d ""
✓ Added alias.
$ glab alias set glic_ch 'issue create -R "gitlab-com/support/dotcom/cmoc-handover" --web -t "CMOC Handover (APAC)" -d ""'
- Adding alias for glic_ch: issue create -R "gitlab-com/support/dotcom/cmoc-handover" --web -t "CMOC Handover (APAC)" -d ""
✓ Added alias.
And now I can create issues, however using the --web
option it delegates the rest of the issue creation to the web browser, which includes selecting a template.