通过Gitlab备注关闭jira bug并添加jira备注

  1. gitlab->[project] ➔ Settings ➔ Integrations➔ Project services➔ JIRA
  2. 设置jira地址、用户名、密码、 transition ID等等


    通过Gitlab备注关闭jira bug并添加jira备注_第1张图片
    image.png

    其中的Transition ID(s)可以通过:

    1)查看JIRA看板流程
    通过Gitlab备注关闭jira bug并添加jira备注_第2张图片
    image.png

    2)查看JIRA工作流transition
    通过Gitlab备注关闭jira bug并添加jira备注_第3张图片
    image.png

    把光标放到其中的dev_ci_done可以看到浏览器最下面提示的网址地址中包含了 transition ID, 跟它旁边括号中的21是一致的。

  3. 提交gitlab代码并且在备注里写上类似"Fix DEMO-1, fix the bug that can not open the page", gitlab就会自动移动BUG状态并添加备注

其中的fix叫“ trigger word”, 支持的所有的 trigger word如下:

Close, Closes, Closed, Closing, close, closes, closed, closing
Fix, Fixes, Fixed, Fixing, fix, fixes, fixed, fixing
Resolve, Resolves, Resolved, Resolving, resolve, resolves, resolved, resolving
Implement, Implements, Implemented, Implementing, implement, implements, implemented, implementing

自动关闭jira bug并添加备注的效果如下:
通过Gitlab备注关闭jira bug并添加jira备注_第4张图片
image.png
注意:
  1. 只有commits 或者merges到默认分支(默认是master)才能响应上述的trigger, 如果想修改默认分支,可以在gitlab里修改
  2. 可以在一个备注里关闭多个bug
  3. 如果发现仅仅能关闭jira bug 但却不能添加备注,原因一般是resolution为空。就像上图中本来期望从"In Progress"到"集成到开发环境"是一个fix bug的步骤,通过gitlab的trigger能够关闭对应的bug并且自动添加备注,但发现只能关闭bug不能添加备注,查看后发现移动到"集成到开发环境“这一步时对应的resolution是unresolved。解决方案就是在工作流中设置移动到"集成到开发环境”时设置resolution为resolved. 经过测试验证没问题后,最终状态再改为"done"
  4. 支持的备注可以类似"Fix DEMO-1, fix the bug that can not open the page"也可以不用中间的逗号"Fix DEMO-1 fix the bug that can not open the page", 也可以把Fix关键词放在其他位置比如中间或者最后" fix the bug that can not open the page, Fix DEMO-1"。但是,其中的DEMO-1必须全部为大写,否则jira识别不了,因为在JIRA中都是大写。

你可能感兴趣的:(通过Gitlab备注关闭jira bug并添加jira备注)