首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

如何将bitbucket存储库与托管的按需版本的FogBugz集成?

作为云计算领域的专家,以及开发工程师,我可以为您回答这个问题。将Bitbucket存储库与托管的按需版本的FogBugz集成需要遵循以下步骤:

首先,您需要在FogBugz中添加Bitbucket存储库作为自定义URL。打开您的FogBugz项目,然后转到“系统”选项卡下的“库”。

接下来,点击“新建库”按钮。在“库”对话框中,输入您的自定义URL,例如:https://yourname.bitbucket.org/yourproject/

然后,点击“保存”按钮。现在,您的CloudFogBugz库已经与Bitbucket存储库集成在一起。

接下来,您需要使用FogBugz API访问托管的按需版本。为了实现这一点,您需要在FogBugz项目的管理页面中转到“API”选项卡,然后生成新的API密钥。记住API密钥。

现在,您可以使用FogBugz API将存储库中的提交添加到库中。为了完成此操作,请获取提交ID的列表,如下所示:

代码语言:bash
复制
curl --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Basic your_access_token" --request "GET" "https://yourname.fogbugz.zendesk.com/api/v2/queries/bugs.json" \
  --data "queries=[{\"q\":{\"bug_query\":[\"project:(your_project_number)]},\"rows\":\"1\",\"page\":\"1\"}}]"

这将返回一个JSON对象,其中包含所有提交ID。复制提交的IDs。

然后,使用以下命令将提交添加到FogBugz中:

代码语言:bash
复制
curl --header "Content-Type: application/json" --header "Accept: application/json" "https://yourname.fogbugz.zendesk.com/api/v2/bugs/{bug_id}/assignments.json?access_token=your_access_token\
  -d 'query="INSERT INTO FogBugz.FOBugZAssignment (bug_id, priority, summary, component, resolution, resolution_date, user, comment)
SELECT BugZilla\_ID, '+(list of priorities)', summary, group\_or\_component, status.name, '+status.name+', DATEADD(dd, 0, EOMONTH(CURTIME(), -1)), '+(list of users)\
  , '+(list of comments)" \
  -d 'values="[{\"Bugzilla\_ID\":'+(list of problem ids)+'},'+(list of component names)+'],[{Bugzilla\_ID:'+(list of problem ids)+'
  },' + (list of priorities)  +'],'+summary+'],'+(list of component names)+'],'+(list of components)+']'

这将返回一个JSON对象,其中包含新提交的详细信息和提交ID。请注意,此操作需要在Git提交后运行,以避免出现重复记录。

希望这些步骤可以帮助您将Bitbucket存储库与托管的按需版本的FogBugz集成。

页面内容是否对你有帮助?
有帮助
没帮助

相关·内容

没有搜到相关的视频

领券