1. 项目协同
  2. 代码仓库
  3. DevOps 实践之旅
  4. 一分钟开始持续集成之旅
  5. 持续部署
  6. 制品库

事件介绍

文章内容
  1. 事件数据结构

Service Hook 每个事件数据结构均不同,通过事件数据结构,用户可以自定义事件发送内容的模板,支持 JsonPath 方式读取 Json 数据。现已支持的事件列表如下:

  • 创建迭代
  • 删除迭代
  • 更新迭代
  • 规划迭代
  • 创建事项
  • 删除事项
  • 增加评论
  • 状态变更
  • 分配处理人
  • 规划迭代
  • 关联关系变更
  • 更新事项信息
  • 代码推送
  • 合并请求创建
  • 合并请求更新
  • 合并请求合并
  • 合并请求关闭
  • 推送制品
  • 更新制品
  • 下载制品
  • 删除制品
  • 发布制品
  • 禁止下载制品
  • 恢复下载制品
  • 下载制品阻断
  • 创建制品仓库
  • 更新制品仓库配置
  • 删除制品仓库
  • 创建构建计划
  • 修改构建计划
  • 删除构建计划
  • 启动构建计划
  • 构建计划执行结束
  • 文件新建
  • 文件更新
  • 文件重命名
  • 文件更改分享状态
  • 文件 / 文件夹移动
  • 文件 / 文件夹复制
  • 文件 / 文件夹移动到回收站
  • 文件 / 文件夹从回收站恢复
  • 文件 / 文件夹彻底删除
  • 文档新建
  • 文档更新
  • 文档移动
  • 文档更改分享状态
  • 文档更改访问设置
  • 文档 / 文档树复制
  • 文档移动到回收站
  • 文档从回收站恢复
  • 文档彻底删除
  • 添加项目成员
  • 移除项目成员
  • 更新项目成员用户组

事件数据结构

项目协同

迭代相关事件:

  • 创建迭代
  • 删除迭代
  • 更新迭代
  • 规划迭代
{
    "event": "",
    "eventName": "",
    "iteration": {
        "title": "",
        "goal": "",
        "html_url": "",
        "project_id": "",
        "code": "",
        "creator": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "status": "",
        "plan_issue_number": "",
        "start_at": "",
        "end_at": "",
        "created_at": "",
        "updated_at": ""
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}

事项相关事件:

  • 创建事项
  • 删除事项
  • 状态变更
  • 分配处理人
  • 规划迭代
  • 关联关系变更
  • 更新事项信息
{
    "event": "",
    "eventName": "",
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "icon": "",
        "url": "",
        "description": "",
        "name": "",
        "display_name": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "url": "",
        "introduction": "",
        "name": "",
        "name_pinyin": "",
        "avatar": ""
    },
    "issue": {
        "html_url": "",
        "type": "",
        "project_id": "",
        "code": "",
        "parent_code": "",
        "title": "",
        "creator": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "status": "",
        "assignee": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "priority": "",
        "start_date": "",
        "due_date": "",
        "description": "",
        "created_at": "",
        "updated_at": "",
        "issue_status": {
            "id": "",
            "name": "",
            "type": ""
        },
        "watchers": [
            {
                "id": "",
                "login": "",
                "avatar_url": "",
                "url": "",
                "html_url": "",
                "name": "",
                "name_pinyin": ""
            }
        ],
        "labels": []
    }
}

事项评论相关事件:

  • 增加评论
{
    "event": "",
    "eventName": "",
    "issueComment": {
        "html_url": "",
        "issue": {
            "project_id": "",
            "html_url": "",
            "code": "",
            "title": "",
            "creator": {
                "id": "",
                "login": "",
                "avatar_url": "",
                "url": "",
                "html_url": "",
                "name": "",
                "name_pinyin": ""
            },
            "status": "",
            "assignee": {
                "id": "",
                "login": "",
                "avatar_url": "",
                "url": "",
                "html_url": "",
                "name": "",
                "name_pinyin": ""
            },
            "priority": "",
            "description": "",
            "created_at": "",
            "updated_at": ""
        },
        "creator": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "content": "",
        "created_at": "",
        "updated_at": ""
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}

代码托管

合并请求相关事件:

  • 合并请求创建
  • 合并请求更新
  • 合并请求合并
  • 合并请求关闭
{
    "event": "",
    "eventName": "",
    "number": "",
    "mergeRequest": {
        "id": "",
        "url": "",
        "html_url": "",
        "patch_url": "",
        "diff_url": "",
        "number": "",
        "state": "",
        "title": "",
        "body": "",
        "user": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "created_at": "",
        "updated_at": "",
        "merge_commit_sha": "",
        "head": {
            "label": "",
            "ref": "",
            "sha": "",
            "user": {
                "id": "",
                "login": "",
                "avatar_url": "",
                "url": "",
                "html_url": "",
                "name": "",
                "name_pinyin": ""
            },
            "repo": {
                "id": "",
                "name": "",
                "full_name": "",
                "owner": {
                    "id": "",
                    "login": "",
                    "avatar_url": "",
                    "url": "",
                    "html_url": "",
                    "name": "",
                    "name_pinyin": ""
                },
                "private": "",
                "html_url": "",
                "description": "",
                "fork": "",
                "url": "",
                "created_at": "",
                "updated_at": "",
                "clone_url": "",
                "ssh_url": "",
                "default_branch": "",
                "vcs_type": ""
            }
        },
        "base": {
            "label": "",
            "ref": "",
            "sha": "",
            "user": {
                "id": "",
                "login": "",
                "avatar_url": "",
                "url": "",
                "html_url": "",
                "name": "",
                "name_pinyin": ""
            },
            "repo": {
                "id": "",
                "name": "",
                "full_name": "",
                "owner": {
                    "id": "",
                    "login": "",
                    "avatar_url": "",
                    "url": "",
                    "html_url": "",
                    "name": "",
                    "name_pinyin": ""
                },
                "private": "",
                "html_url": "",
                "description": "",
                "fork": "",
                "url": "",
                "created_at": "",
                "updated_at": "",
                "clone_url": "",
                "ssh_url": "",
                "default_branch": "",
                "vcs_type": ""
            }
        },
        "merged": "",
        "comments": "",
        "commits": "",
        "additions": "",
        "deletions": "",
        "changed_files": ""
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "repository": {
        "id": "",
        "name": "",
        "full_name": "",
        "owner": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "private": "",
        "html_url": "",
        "description": "",
        "fork": "",
        "url": "",
        "created_at": "",
        "updated_at": "",
        "clone_url": "",
        "ssh_url": "",
        "default_branch": "",
        "vcs_type": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}

代码推送相关事件:

  • 代码推送
{
    "event": "",
    "eventName": "",
    "ref": "",
    "before": "",
    "after": "",
    "created": "",
    "deleted": "",
    "compare": "",
    "commits": [
        {
            "id": "",
            "distinct": "",
            "message": "",
            "timestamp": "",
            "url": "",
            "author": {
                "name": "",
                "email": "",
                "username": ""
            },
            "committer": {
                "name": "",
                "email": "",
                "username": ""
            },
            "added": "",
            "removed": "",
            "modified": [""]
        }
    ],
    "head_commit": {
        "id": "",
        "distinct": "",
        "message": "",
        "timestamp": "",
        "url": "",
        "author": {
            "name": "",
            "email": "",
            "username": ""
        },
        "committer": {
            "name": "",
            "email": "",
            "username": ""
        },
        "added": "",
        "removed": "",
        "modified": [""]
    },
    "pusher": {
        "name": "",
        "email": "",
        "username": ""
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "repository": {
        "id": "",
        "name": "",
        "full_name": "",
        "owner": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "private": "",
        "html_url": "",
        "description": "",
        "fork": "",
        "url": "",
        "created_at": "",
        "updated_at": "",
        "clone_url": "",
        "ssh_url": "",
        "default_branch": "",
        "vcs_type": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}

持续集成

持续集成相关事件:

  • 创建构建计划
  • 修改构建计划
  • 删除构建计划
  • 启动构建计划
  • 构建计划执行结束
{
    "event": "",
    "eventName": "",
    "ci": {
        "id": "",
        "name": "",
        "branch_regex": "",
        "cron_spec": "",
        "creator_id": "",
        "project_id": "",
        "depot_id": "",
        "execute_in": "",
        "jenkins_file_path": "",
        "created_at": "",
        "updated_at": "",
        "trigger_method": "",
        "branch_selector": "",
        "hook_type": "",
        "trigger_remind": "",
        "build": {
            "id": "",
            "number": "",
            "cci_id": "",
            "cause": "",
            "commit_id": "",
            "branch": "",
            "uuid": "",
            "job_id": "",
            "trigger_user_id": "",
            "created_at": "",
            "updated_at": "",
            "pre_status": "",
            "failed_message": "",
            "duration": "",
            "status": "",
            "status_node": ""
        }
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "repository": {
        "id": "",
        "name": "",
        "full_name": "",
        "owner": {
            "id": "",
            "login": "",
            "avatar_url": "",
            "url": "",
            "html_url": "",
            "name": "",
            "name_pinyin": ""
        },
        "private": "",
        "html_url": "",
        "description": "",
        "fork": "",
        "url": "",
        "created_at": "",
        "updated_at": "",
        "clone_url": "",
        "ssh_url": "",
        "default_branch": "",
        "vcs_type": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}

制品库

制品仓库相关事件:

  • 创建制品仓库
  • 更新制品仓库配置
  • 删除制品仓库
  • 推送制品
  • 更新制品
  • 下载制品
  • 删除制品
  • 发布制品
  • 禁止下载制品
  • 恢复下载制品
  • 下载制品阻断
{
    "event": "",
    "eventName": "",
    "artifact": {
        "projectId": "",
        "artifactRepoId": "",
        "artifactPkgId": "",
        "artifactVersionId": "",
        "userId": "",
        "size": "",
        "artifactRepoName": "",
        "artifactPkgName": "",
        "artifactVersionName": "",
        "action": "",
        "artifactType": "",
        "projectName": "",
        "userName": ""
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}

Wiki 文档

  • 文档新建
  • 文档更新
  • 文档移动
  • 文档更改分享状态
  • 文档更改访问设置
  • 文档 / 文档树复制
  • 文档移动到回收站
  • 文档从回收站恢复
  • 文档彻底删除
{
    "event": "",
    "eventName": "",
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "icon": "",
        "url": "",
        "description": "",
        "name": "",
        "display_name": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "url": "",
        "introduction": "",
        "name": "",
        "name_pinyin": "",
        "avatar": ""
    },
    "content": {
        "title": "",
        "url": "",
        "parentName": "",
        "parentUrl": "",
        "shareUrl": ""
    }
}

文件网盘

文件网盘相关事件:

  • 文件新建
  • 文件更新
  • 文件重命名
  • 文件更改分享状态
{
    "event": "",
    "eventName": "",
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "icon": "",
        "url": "",
        "description": "",
        "name": "",
        "display_name": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "url": "",
        "introduction": "",
        "name": "",
        "name_pinyin": "",
        "avatar": ""
    },
    "content": {
        "to_folder_id": "",
        "count": "",
        "file": {
            "name": "",
            "url": "",
            "id": "",
            "full_path": "",
            "folder_id": "",
            "folder_name": ""
        },
        "to_folder_name": "",
        "done": ""
    }
}

文件网盘相关事件:

  • 文件 / 文件夹移动
  • 文件 / 文件夹复制
  • 文件 / 文件夹移动到回收站
  • 文件 / 文件夹从回收站恢复
  • 文件 / 文件夹彻底删除
{
    "event": "",
    "eventName": "",
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": "lk|liaokai"
    },
    "project": {
        "id": "",
        "icon": "",
        "url": "",
        "description": "",
        "name": "",
        "display_name": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "url": "",
        "introduction": "",
        "name": "",
        "name_pinyin": "",
        "avatar": ""
    },
    "content": {
        "to_folder_id": "",
        "count": "",
        "files": [
            {
                "name": "",
                "url": "",
                "id": "",
                "folder_id": "",
                "is_renamed": ""
            }
        ],
        "to_folder_name": ""
    }
}

项目成员

项目成员相关事件:

  • 添加项目成员
  • 移除项目成员
  • 更新项目成员用户组
{
    "event": "",
    "eventName": "",
    "member": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "sender": {
        "id": "",
        "login": "",
        "avatar_url": "",
        "url": "",
        "html_url": "",
        "name": "",
        "name_pinyin": ""
    },
    "project": {
        "id": "",
        "name": "",
        "display_name": "",
        "description": "",
        "icon": "",
        "url": ""
    },
    "team": {
        "id": "",
        "domain": "",
        "name": "",
        "name_pinyin": "",
        "introduction": "",
        "avatar": "",
        "url": ""
    }
}
上一篇服务类型
最近更新
感谢反馈有用
感谢反馈没用

在阅读中是否遇到以下问题?

您希望我们如何改进?