在GitLab CE 7.8 之後GitLab 就不用一定要使用更好的付費版本或是增加一堆雜七雜八的外掛才能與JIRA整合,不是負責人中大獎就是他們真的佛啊!<br /> 這篇就是在試試過程中做做筆記順便看看結果如何如何最後整理整理一下的產物<br /> <br /> <!--more--><br /> <br /> 版本:<br /> JIRA 6.3.12<br /> GitLab CE 9.0.4<br /> <br /> 設置<br /> <br /> JIRA部分<br /> 1. 首先創一個公用帳號用來連GitLab,這邊取名叫<strong><em>GitLab<br /> </em></strong>&nbsp; &nbsp; &nbsp;(取這名的原因是後面的畫面會比較好看而且一目了然,<br /> 但是怕與GitLab搞混所以以下以<strong><em>斜體和加粗</em></strong>做為區分)<br /> <br /> 2. 各JIRA專案管理者將對GitLab有需求的專案,加入<strong><em>GitLab</em></strong>至專案team(加入Users即可)<br /> 方法:<br /> 專案-&gt;Administration-&gt;Role-&gt;View Project Roles<br /> <img class=" wp-image-608 alignnone" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/彙總1.png" alt="" width="587" height="394" /><br /> <br /> &nbsp;<br /> 確認該專案是否能連到GitLab:<br /> <img class="alignnone wp-image-609" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab2.png" alt="" width="500" height="324" /><br /> User : <strong><em>GitLab</em></strong>Permission : Add Comments<br /> (因為GitLab有消息都是傳到Comment的Tag,<br /> 所以這邊只要有Add Comment的權限就可以了)<br /> <img class="alignnone wp-image-610" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab3.png" alt="" width="492" height="387" /><br /> 顯示出這個帳號的狀態是可以使用'Add Comments'權限<br /> <img class="alignnone wp-image-611" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab4.png" alt="" width="497" height="202" /><br /> 顯示出這個帳號的狀態是不可以使用'Add Comments'權限<br /> <br /> &nbsp;<br /> 到這邊之後JIRA設定的部分就結束了,接下來看GitLab部分的設定<br /> <br /> &nbsp;<br /> GitLab部分<br /> Settings -&gt; Service Templates -&gt; JIRA<br /> <br /> <img class="alignnone wp-image-612" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab5.png" alt="" width="494" height="428" /><br /> Active : &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 開啟這功能<br /> Trigger: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;甚麼時候會通知JIRA<br /> URL: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JIRA首頁的URL<br /> Project key : &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;每個自己專案的Project key (在公共的這邊隨意)<br /> Username: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 剛剛創建的JIRA User<br /> Change Password : &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;剛剛創建的JIRA User的密碼<br /> Jira issue transition : &nbsp; &nbsp; &nbsp; &nbsp; JIRA 的issue transition,通常是2<br /> <br /> 就是這麼佛心 一下就設定完了 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 佛心公司/佛心公司/<br /> 到這邊全部都設定完了,接下來看看使用狀況怎麼樣<br /> <br /> &nbsp;<br /> &nbsp;<br /> 使用<br /> <br /> GitLab -&gt;JIRA<br /> <br /> 在Comment加入Issue單號的辦法:<br /> 1. 前後除了空白沒有其他字元<br /> 2.可以換行與一次多個issue<br /> <br /> &nbsp;<br /> 1. Comment<br /> 在comment輸入JIRA 的 issue問題單號 &nbsp; 就會出現一個連結可以直接連到該Issue單的頁面<br /> <img class="alignnone wp-image-614" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab6.png" alt="" width="441" height="80" /><br /> <br /> &nbsp;<br /> 2.&nbsp;Commit<br /> 在commit輸入JIRA 的 issue問題單號<br /> <br /> <img class="alignnone wp-image-615" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab7.png" alt="" width="535" height="247" /><br /> <br /> &nbsp;<br /> 3.&nbsp;Branch<br /> **不會特別在JIRA上顯示是在branch還是master<br /> 4.Merge<br /> 會在merge request 和成功的時候發出訊息<br /> <img class="alignnone wp-image-617" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab8-1.png" alt="" width="528" height="183" /><br /> Cherry pick會特別顯示<br /> <br /> <img class="alignnone wp-image-618" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab9.png" alt="" width="524" height="96" /><br /> JIRA-&gt;GitLab<br /> <br /> <img class="alignnone wp-image-623" src="http://blog.gss.com.tw/wp-content/uploads/2017/04/JIRAGitLab10.png" alt="" width="533" height="119" /><br /> 1.會連到<em>GitLab</em>的JIRA頁面<br /> 2.會連到發出此次變更的使用者的GitLab首頁<br /> 3.會連到GitLab此次變更的畫面<br /> 4.會連到JIRA Issue的頁面<br /> <br /> 以上,謝謝收看
評論 1
官網雖然有一篇專文 https://docs.gitlab.com/ee/user/project/integrations/jira.html 在講這件事,不過因為版本快速推陳出新的關係,還是有不少小地方會讓人卡住,有這篇能佐證 JIRA 6 / 7 與 GitLab 7.8 以上真的能整合也算是功德一件。