在 JIRA 模板中显示组件的问题类型和问题
在发行说明速度模板 ( [jira-install-dir]\atlassian-jira\WEB-INF\classes\templates\jira\project\releasenotes\releasenotes-html.vm ) 中,显示的问题组织在 IssueTypes 下
: >错误
- 问题1
- 问题2...
改进
- 问题1
- 问题2...
我正在尝试找到一种方法来组织组件下的问题类型和问题,或组件和IssueTypes 下的问题:
组件
- Bug
- 问题 1
- 问题 2...
- 改进
- 问题 1
- 问题 2...
或
Bug
- 组件 A
- 问题 1
- 问题 2...
- 组件 B
- 问题 1
- 问题 2...
改进
- 组件 A
- 问题 1
- 问题 2...
目前它从每个问题类型中获取问题:
#foreach ($issueType in $issueTypes)
#if($issueType.issues.size() > 0)
<h2>$textUtils.htmlEncode($issueType.name)</h2>
<ul>
#foreach ($issue in $issueType.issues)
<li>[<a href='$!appProps.getString("jira.baseurl")/browse/$issue.key'>$issue.key</a>]
$textUtils.htmlEncode($issue.summary)#getReleaseNoteLoggedonBehalfof($issue
$customFieldManager)</li>
#end
</ul>
#end
#end
我想完成类似的事情(伪代码...请原谅嵌套循环,这就是我的大脑现在的工作方式,我当我有更多时间时,我会编写更少的代码!:P)
#foreach ($component in $components)
#foreach ($issueType in $component.issueTypes)
#if($issueType.issues.size() > 0)
<h2>$textUtils.htmlEncode($issueType.name)</h2>
<ul>
#foreach ($issue in $issueType.issues)
<li>[<a href='$!appProps.getString("jira.baseurl")/browse/$issue.key'>$issue.key</a>]
$textUtils.htmlEncode($issue.summary)#getReleaseNoteLoggedonBehalfof($issue
$customFieldManager)</li>
#end
</ul>
#end
#end
#end
我可以通过 Velocity 模板访问组件的问题/问题类型吗?或者,如果有更好的方法来实现这一点,我洗耳恭听!
谢谢
In the Release Notes velocity template ( [jira-install-dir]\atlassian-jira\WEB-INF\classes\templates\jira\project\releasenotes\releasenotes-html.vm ), the issues shown are organized under IssueTypes:
Bug
- Issue 1
- Issue 2...
Improvement
- Issue 1
- Issue 2...
I am trying to find a way to organize IssueTypes and Issues under Components, OR Components and Issues under IssueTypes:
Component
- Bug
- Issue 1
- Issue 2...
- Improvement
- Issue 1
- Issue 2...
OR
Bug
- Component A
- Issue 1
- Issue 2...
- Component B
- Issue 1
- Issue 2...
Improvement
- Component A
- Issue 1
- Issue 2...
Currently it grabs the issues from each issueType:
#foreach ($issueType in $issueTypes)
#if($issueType.issues.size() > 0)
<h2>$textUtils.htmlEncode($issueType.name)</h2>
<ul>
#foreach ($issue in $issueType.issues)
<li>[<a href='$!appProps.getString("jira.baseurl")/browse/$issue.key'>$issue.key</a>]
$textUtils.htmlEncode($issue.summary)#getReleaseNoteLoggedonBehalfof($issue
$customFieldManager)</li>
#end
</ul>
#end
#end
I'd like to accomplish something like this (pseudo code... excuse the nested loops it's just how my brain is working right now, I'll write less code when I have more time! :P)
#foreach ($component in $components)
#foreach ($issueType in $component.issueTypes)
#if($issueType.issues.size() > 0)
<h2>$textUtils.htmlEncode($issueType.name)</h2>
<ul>
#foreach ($issue in $issueType.issues)
<li>[<a href='$!appProps.getString("jira.baseurl")/browse/$issue.key'>$issue.key</a>]
$textUtils.htmlEncode($issue.summary)#getReleaseNoteLoggedonBehalfof($issue
$customFieldManager)</li>
#end
</ul>
#end
#end
#end
Can I access the Issues/IssueTypes of a Component through a Velocity template? Alternatively, if there is a better way to accomplish this I'm all ears!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 Jira 在速度中使用 MVC 模式,因此您只能访问控制器提供的数据。似乎只有 $issueTypes 是与您相关的数据,因此通常无法获取渲染此类结构所需的唯一组件列表。
因此,我建议编写一个自己的插件模块(例如报告)。
在 java 中获取并组织您的问题以具有结构 List>组件,然后你应该很容易渲染它。
Because Jira uses the MVC pattern in velocity you have only access to data provided by controller. It seems that only $issueTypes are relevant data for you and so in general there is no way to get unique list of components which are required to render such a structure.
I therefore suggest to write an own plugin module (for example report).
Fetch and organize your issues in java to have a structure List> components and then should be easy for you to render it.