Variable substitution in templates
Problem to solve
Currently we don't support variable substitution within templates. It would be great to be able to insert some values, to better support a few workflows:
- In our issue creation API, you could specify a template along with variable key value pairs.
- For the creation of issues from alerts, where we'd like to insert some values like labels that may be coming in from the webhook receiver.
Some use cases for this:
- An alert could specify desired labels to apply, and it could be easily translated to the template with something like
/label {{ alert.labels }}
- A desired @mention or assignee could also be included in the request
Target audience
-
Parker, Product Manager, https://design.gitlab.com/research/personas#persona-parker
-
Delaney, Development Team Lead, https://design.gitlab.com/research/personas#persona-delaney
-
Sasha, Software Developer, https://design.gitlab.com/research/personas#persona-sasha
-
Devon, DevOps Engineer, https://design.gitlab.com/research/personas#persona-devon
-
Sidney, Systems Administrator, https://design.gitlab.com/research/personas#persona-sidney
-
Sam, Security Analyst, https://design.gitlab.com/research/personas#persona-sam
Further details
Proposal
Add a framework to support variable substitution within the markdown template.
We could use GitLab's Changelog Custom Templates markup language.
Perhaps something like the liquid markup language: https://github.com/Shopify/liquid (See !50063 (comment 480180915))
Upon issue creation, these variables could then be populated with their appropriate values.
What does success look like, and how can we measure that?
Links / references
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.