feat: Add --template argument for issue create

Description

Add --template argument for issue create

The interactive command allows selecting a template, but fully automated operation does not. This adds a --template arg that can be used in either interactive or non-interactive mode to select and use the given template.

Resolves #8087

How has this been tested?

Tested with a local build, in a (private) playground project of mine that had a template:

cmiskell@unspeakable-aklu:~/src/playground [foo] $ ~/src/gitlab-org/cli/bin/glab issue create --template new-incident --title "My Test Issue" -y
- Creating issue in cmiskell/playground
#16 My Test Issue (less than a minute ago)
 https://gitlab.com/cmiskell/playground/-/issues/16

Notes

Purely the work of Duo, but I did self-review the code and it looks entirely plausible (there's only so many ways to achieve this sort of thing in Go).

EDIT: although clearly not well enough to spot the pointless assignment in the first commit :shame:

Edited by Craig Miskell

Merge request reports

Loading