Skip to content

Draft: tissues - Create issues from templates via glab

Michael Trainor requested to merge tissues-template-issues into main

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:

  1. Get the issue template content via API
  2. 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:

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.

Edited by Michael Trainor

Merge request reports