TeamCity API计算出调查开始了多长时间?

时间:2017-05-11 15:10:55

标签: teamcity

使用TeamCity API:

我们正在尝试整合一个仪表板,以确定构建失败的时间,有人将自己分配给构建/项目的调查。

我们无法找到一种方法来执行此操作,因为调查分配给项目而不是构建,因此无法找出特定构建的调查何时开始?

1 个答案:

答案 0 :(得分:0)

如果您需要调查构建配置,可以使用以下REST API:

http://teamcity:8111/app/rest/investigations?locator=buildType:(id:XXXX)

例如,以下请求 https://teamcity.jetbrains.com/app/rest/investigations?locator=buildType:(id:Epigenome_GenestackTests)

返回以下响应,分配节点下的时间戳



<?xml version="1.0" encoding="UTF-8"?>
<investigations count="1" href="/app/rest/investigations?locator=buildType:(id:Epigenome_GenestackTests)">
   <investigation id="buildType:(id:Epigenome_GenestackTests)" state="TAKEN" href="/app/rest/investigations/buildType:(id:Epigenome_GenestackTests)">
      <assignee username="evgeny.kurbatsky" name="Evgeny.Kurbatsky" id="1107" href="/app/rest/users/id:1107" />
      <assignment>
         <user username="oleg" name="Oleg Shpynov" id="2" href="/app/rest/users/id:2" />
         <timestamp>20160321T122158+0000</timestamp>
      </assignment>
      <scope>
         <buildTypes count="1">
            <buildType id="Epigenome_GenestackTests" name="Genestack Tests" paused="true" description="Fast tests" projectName="BioLabs :: Epigenome" projectId="Epigenome" href="/app/rest/buildTypes/id:Epigenome_GenestackTests" webUrl="https://teamcity.jetbrains.com/viewType.html?buildTypeId=Epigenome_GenestackTests" />
         </buildTypes>
      </scope>
      <target anyProblem="true" />
      <resolution type="whenFixed" />
   </investigation>
</investigations>
&#13;
&#13;
&#13;