Am I Understanding Correctly About Issue Templates / Possibilities?
Possible Soln In Comment Below?
Problem Description:
I have a use case that I was hoping would be possible (maybe with some slight variation) and an anti-use case (that would not work for me). Based on the information I'm finding it seem this is not possible? Is that correct? Also, I have considered a couple different approaches that SEEM like they should work; but, so far, none of them seems possible. I've listed them at the bottom of this post. Are any of them possible or is there some other approach or existing solution that would work?
Desired use case (or close to it):
I want to have issue description boilerplate appear in the issue description after clicking “New issue” but before clicking “Create” and have the content of said boilerplate be based on the value of my Type field in the issue. For example, suppose I have available values A, B, and C for the Type field. After clicking “New issue” a different boilerplate content should appear in the issue description for A or B or C. This implies that the behavior before clicking “Create” would be that as many times as the value of the Type field is changed, the boilerplate changes in the description field. If one were to change the value of the Type field 10 times before clicking the “Create” button (suppose they are very confused - or drunk) then the boilerplate in the description field would change 10 times. Not that you would actually do this but its an illustration of the desired behavior.
Anti-use case (do not prefer):
To have to bookmark each template in your browser and then navigate to that bookmark using your bookmark manager (instead of the usual ux of clicking “New issue”) to initiate the creation of a new issue.
Approaches Considered:
- Use issue urls for each template but create a workflow that redirects from the url you get when you click “New issue” to the desired template url based on the value set in the Type field? This would mean the workflow would have to check the value set in the Type field and then redirect to the appropriate template url?
- Use an app (eg: create a custom app if necessary) that does that same? ^
- Use an already existing solution? Is there one?
Thanks for any help on this. I'm having a difficult time understanding the official documentation for some reason and I haven't yet found anything related to my needs. I would, however, love some help with my specific use case / question as stated here.
Please sign in to leave a comment.
Hi Jake!
The easiest approach to provide issue templates is through the visual workflow constructor. Please see this article for details: SUPPORT-A-3012 Default description templates for different issue types.
Exactly.
This must be a documentation error. Thanks for spotting it; we've let our documentation team know so they can fix it.
I've been thinking real hard about this and I think the core thing I was unsure about was whether a workflow can be executed for an issue during its creation (ie: after “New issue” is clicked but before “Create” is clicked). The only other questionable thing I think is whether a workflow (or some part of it) can be run continuously UNTIL “Create” is clicked - but I may have the wrong question on that one.
I see the follwing page again: https://www.jetbrains.com/help/youtrack/devportal/Workflow-Default-Description.html#use-case
and I see a line of code in the guard block in the example
return !issue.isReported && !issue.becomesReported && issue.description === null;. I'm guessing that maybe the!issue.isReported && !issue.becomesReportpart of that line is what makes the workflow execute before “Create” is clicked? If so that just leaves the question of being able to have the workflow basically “listen” for changes to the field and exit when “Create” is clicked. Adding content based on the value of a field seems to already be talked about on the linked page? So then the algorithm I'd need the workflow to implement becomes…?Something like that? But I still wonder if there are limitations with workflows that would prevent all that from happening? I see “Due to technical limitations, this rule can’t be applied at the moment when the New Issue page opens” on this page (which makes me question it): https://www.jetbrains.com/help/youtrack/devportal/streamline-issue-reporting-workflows.html#build-issue-templates
Stanislav Dubin
Thanks man. MUch appreciated.
I'm not a fan of Shortcut, but I'd love for the drop down arrow on a “New card”, to show a list of templates, and there be a place to manage the templates, not just managing a collection of URLs. Having Users go to a KB for “creating new cards” or having to have bookmarks saved for each one feels like an odd break in user workflow.
Fwiw, I tried for about 4 days to make some kind of templates work with a javascript workflow. In the end I found out it just isn't possible and found some brief mention in the documentation to that effect. I'm sure I had read it before but just didn't see how there couldn't be a way to implement some kind of issue templates that could be selected from within the issue - I was wrong. I ended up leaving youtrack (not only for that reason).
Hi Jake,
I'm Sergey from the YouTrack Team. Thanks for reaching out!
Custom templates are definitely possible in YouTrack, though they work a bit differently than, for example, shown in your screenshot. Here are a few approaches you can explore:
Workflow-based templates: As Stanislav mentioned earlier in the thread, you can use workflows to automatically populate issue descriptions based on field values. For example, the workflow can trigger when an issue draft is created and update the description based on the Type field value. Check out Default description templates for different issue types for implementation details.
Custom apps: You can create a custom app that provides access to templates within YouTrack's interface. The Apps Documentation explains how to build these.
Third-party plugins: There are existing plugins that might fit your needs:
I understand you've already moved on from YouTrack, but I wanted to clarify that template functionality does exist. If you or anyone else reading this thread would like more specific guidance on implementing any of these approaches, feel free to reach out!