工作中经常需要在周报、月报、年报对禅道bug数据进行不同维度统计导出,以下是我常用的统计sql

1、统计2022年每个月bug数(deleted='0'是查询未删除的bug)

  1. select DATE_FORMAT(a.openedDate,'%Y-%m') as '月份',count(DATE_FORMAT(a.openedDate,'%Y-%m')) 'bug数量' from zt_bug a
    where a.deleted='0' and a.openedDate>'2022-01-01' and a.openedDate<'2023-01-01' GROUP BY DATE_FORMAT(a.openedDate,'%Y-%m')

2、统计2022年测试人员每个月创建bug数量

  1. select c.realname '创建人', DATE_FORMAT(a.openedDate,'%Y-%m') as '月份',count(c.realname) 'bug数量' from zt_bug a
  2. left join zt_user c on a.openedBy=c.account
  3. where a.deleted='0' and a.openedDate>'2022-01-01' and a.openedDate<'2023-01-01' GROUP BY c.realname,DATE_FORMAT(a.openedDate,'%Y-%m')

3、统计2022年开发人员每个月被指派bug数量(有效bug排除5个resolution解决方案:external外部原因,bydesign设计如此,willnotfix不予解决,notrepro无法重现,duplicate重复bug)

  1. select IF(a.resolution !='',f.realname,e.realname) '解决人',DATE_FORMAT(a.openedDate,'%Y-%m') as '月份',count(1) 'bug数量' from zt_bug a
  2. left join zt_user f on a.resolvedBy=f.account
  3. left join zt_user e on a.assignedTo=e.account
    where a.deleted='0' and a.openedDate>'2022-01-01' and a.openedDate<'2023-02-16' and a.resolution not in ('external','bydesign','willnotfix','notrepro','duplicate')
    GROUP BY IF(a.resolution !='',f.realname,e.realname),DATE_FORMAT(a.openedDate,'%Y-%m')

4、统计某段时间内的bug详细数据,将代码转化为中文、将用户名转化成中文

  1. select a.id 'BugID',b.name '产品',
  2. case a.type when 'designdefect' then '设计缺陷' when 'codeerror' then '代码错误' when 'standard' then '标准规范' when 'others' then '其它' when 'config' then '配置相关'
    when 'interface' then '界面优化' when 'install' then '安装部署' end 'Bug类型',
  3. a.title 'Bug标题',a.severity '级别',a.pri '优先级',
  4. case a.status when 'closed' then '已关闭' when 'resolved' then '已解决' when 'active' then '激活' end '状态',
  5. c.realname '创建人',a.openedDate'创建时间',i.name '项目',d.name '版本',e.realname '指派人',g.name '组别',f.realname '解决人',h.name '组别(已解决)',a.activatedCount '激活次数',a.resolvedDate '解决时间',
  6. case a.resolution when 'fixed' then '已解决' when 'external' then '外部原因' when 'bydesign' then '设计如此' when 'willnotfix' then '不予解决' when 'notrepro' then '无法重现'
    when 'postponed' then '延期处理' when 'duplicate' then '重复bug' end as '解决方案' from zt_bug a
  7. left join zt_product b on b.id=a.product
  8. left join zt_user c on a.openedBy=c.account
  9. left join zt_user f on a.resolvedBy=f.account
  10. left join zt_user e on a.assignedTo=e.account
  11. left join zt_build d on d.id=a.openedBuild
  12. left join zt_dept h on f.dept=h.id
  13. left join zt_dept g on e.dept=g.id
  14. left join zt_project i on d.project=i.id
  15. -- where DATE_SUB(CURDATE(),INTERVAL 6 DAY) <= date(a.openedDate) and a.deleted='0'
  16. where a.deleted='0' and a.openedDate>'2023-01-01' and a.openedDate<'2023-02-01'

5、统计某段时间内各项目bug情况:产品+项目名+版本名+数量

  1. select b.name '产品',i.name '项目',d.name '版本',count(d.name) as "bug总数量" from zt_bug a
    left join zt_product b on b.id=a.product
    left join zt_build d on d.id=a.openedBuild
    left join zt_project i on d.project=i.id
    where a.openedDate>'2022-10-01' and a.openedDate<'2022-11-01' and a.deleted='0' and d.name is not null
    group by b.name,i.name,d.name ORDER BY count(d.name) desc

基于禅道数据库对bug进行不同维度统计的更多相关文章

  1. windows系统搭建禅道系统(BUG管理工具)

    我也呆过三家公司了,用过的BUG管理工具也是五花八门的,常见的一般有禅道,bugzilla,jira等 个人比较推荐禅道,功能强大,主页的说明文档也是相当详细,最主要的是,用的人比较多,出现使用问题一 ...

  2. 使用钉钉对接禅道的bug系统,实现禅道提的bug实时在钉钉提醒并艾特对应的开发人员处理

    现在公司测试中有一个痛点是每次测试人员提完bug后,需要定期去提醒开发人员查看禅道的bug记录及修复bug. 导致测试人员在项目测试中不仅要测试整个软件,还要负起实时监督提醒功能的“保姆角色”,身心疲 ...

  3. python数据统计之禅道bug统计

    背景 通过定期输出 每条产品的 BUG 情况,以此来反馈开发解决问题.测试跟进问题的情况:钉钉群推送提醒开发及时解决 以此我这边开始着手准备编写一个小工具,最终达到目的:自动定期发送统计报告,报告维度 ...

  4. python tornado 实现类禅道系统

    最近楼主加班 喽, 好久没有更新我的博客了,哎,一言难尽,废话我就不说了,来开始上精华. 背景:目前市面上有很多bug管理工具,但是各有各的特点,最著名,最流行的就是禅道,一个偶然的机会接触到了pyt ...

  5. 如何在Linux服务器上部署禅道

    最近换了新的项目团队,由于新团队比较年轻化,没有实行正规的项目管理,于是我自告奋勇要为团队管理出一份力,帮助团队建立敏捷化的项目管理,经过多方考究和对比后,选择了目前较受欢迎的开源项目管理软件:禅道. ...

  6. Docker搭建Zentao(禅道)

    禅道搭建方式有很多种,可参考官方文档搭建,这里介绍的是参考官方文档以docker方式搭建. 禅道内部默认会自动安装mysql数据库. 一.下载地址 禅道开源版:   http://dl.cnezsof ...

  7. 禅道导入bugfree 3.0的数据

    禅道项目导入bugfree功能只支持到2.0, 官方不提供3.0的导入,只好自己写了一个.因为bugfree 3.0换人开发了,表结构和禅道差别很大,所以,这个工具不是完全转换,一些History表内 ...

  8. 禅道docker化(Centos7.2)

    操作步骤 确认服务器禅道版本及容器禅道版本 服务器禅道版本:9.6.2 容器禅道版本:9.6.3 版本sql比对 下载官方9.6.3源码包url:http://dl.cnezsoft.com/zent ...

  9. 禅道迁移(windows_to_linux)

    需求分析 随着禅道数据的增加,原来通过虚拟机提供的mysql服务器相应速度跟不上需求.且原来禅道的前端与数据库分离安装在windows与linux中,现在提供实体服务器,需要将禅道环境迁移. 确认环境 ...

  10. Linux部署禅道Steps&Q&A

    1.查看Linux的位数: getconf LONG_BIT 结果:32/64 2. 禅道开源版安装包下载 Linux 64位 下载站点1: http://sourceforge.net/projec ...

随机推荐

  1. ncnn的blob_vkallocator、workspace_vkallocator、staging_vkallocator区别

    ncnn::Extractor中有三个成员函数: void set_blob_vkallocator(VkAllocator* allocator); void set_workspace_vkall ...

  2. C# .NET 压缩ZIP时 OOM OutOfMemoryException

    C# .NET 压缩ZIP时 OOM OutOfMemoryException. ZipArchiveEntry.ZipEntry.SharpZipLib.ZipOutputStream.OutOfM ...

  3. The model backing the 'MainDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).

    The model backing the 'MainDbContext' context has changed since the database was created. Consider u ...

  4. vm ware 虚拟WIN XP 时卡

    主机是I7 9700,SN750 NVME 1T SSD, 32G 内存,VM WARE 14,理论上虚拟WIN XP 不会卡,但实际情况就是很卡. 虚拟WIN7 ,WIN 10,UBUNTU LIN ...

  5. requests高级操作

    requests的Cookie处理 有时相关的需求会让我们去爬取基于某些用户的相关用户信息,例如爬取张三人人网账户中的个人身份信息.好友账号信息等. 那么这个时候,我们就需要对当前用户进行登录操作,登 ...

  6. Vue学习:16.组件通信

    组件通信就是指组件之间的数据传递.由于组件的数据是独立的,无法直接访问其他组件的数据,所以想要使用其他组件数据必须通过 组件通信! 在Vue.js中,组件之间的通信可以通过多种方式实现,包括 prop ...

  7. http请求方式-OkHttpClient

    http请求方式-OkHttpClient import com.example.core.mydemo.http.OrderReqVO; import okhttp3.*; import org.s ...

  8. mysql 8.0 客户端

    1.mysql 8.0 command line client 2.mysql workbench

  9. 新浪微博动态 RSA 分析图文+登录

    Tips:当你看到这个提示的时候,说明当前的文章是由原emlog博客系统搬迁至此的,文章发布时间已过于久远,编排和内容不一定完整,还请谅解` 新浪微博动态 RSA 分析图文+登录 日期:2016-10 ...

  10. JSONPATH-阿里和jayway的实现测试

    业务业务的需要,所以想找一个从对象中获取属性的工具. 搜了搜发现由阿里和jayway的实现,又花费了一些时间了解和练习,总结了一些要点: 阿里的可能快一些,但考虑到完备性,也许选择jayway更好一些 ...