2
1
0
1 回答
- 432
ラベル、コンポーネント共にコレクション値(java.util.Set)のため
文字列のみにするためには、以下のような変数展開が必要です。
#set($labelString='') #foreach ($label in $issue.getLabels()) #if ($velocityCount == 0) #set ($labelString = $label.getLabel()) #else #set ($labelString = $labelString + ' ' + $label.getLabel()) #end #end #set($componentString='') #foreach ($component in $issue.getComponentObjects()) #if ($velocityCount == 0) #set ($componentString = $component.getName()) #else #set ($componentString = $componentString + ' ' + $component.getName()) #end #end ($issue.key) $labelString $componentString $issue.summary
必ず検証環境でご確認ください。
ご参考になりましたら、幸いです。
- 伊藤看寿
ラベルとコンポーネントは複数設定できるので、このような処理が必要なんですね。 勉強になります。
コメントを追加...
デフォルトではキーとタイトルが表示されるところに、ラベルとコンポーネント名を追加したいです。
設定を以下にしたのですが、ラベルが[]でくくられたり、コンポーネントはnameやassigneetypeなどが表示されてしまいます。
($issue.key) $issue.getLabels():$issue.getComponents():$issue.summary
メールの件名がいかになるようにはどのようにすればいいですか?
[JIRA] (キー番号) ラベル:コンポーネント:要約