IBM Jazz Team Server:如何从更改集中检索更改?

时间:2011-12-09 15:27:54

标签: java rest changeset jazz

我使用REST API从项目中检索更改集。我得到以下回复:

{
  "changes": [
    {
      "kind": 2,
      "item": {
        "uri": "itemOid\/com.ibm.team.filesystem.FileItem\/_2ItWACJKEeGAaaEbbqTtgw",
        "itemId": "_2ItWACJKEeGAaaEbbqTtgw",
        "com.ibm.team.repository.typeName": "com.ibm.team.filesystem.FileItem"
      },
      "before": "_Rx7-BCJaEeG25dOp_iUerQ",
      "after": "_Ngn9BCJeEeG25dOp_iUerQ",
      "internalId": "_NhCzwCJeEeG25dOp_iUerQ"
    },
    {
      "kind": 1,
      "item": {
        "uri": "itemOid\/com.ibm.team.filesystem.FileItem\/_GWB-kCJeEeGAaaEbbqTtgw",
        "itemId": "_GWB-kCJeEeGAaaEbbqTtgw",
        "com.ibm.team.repository.typeName": "com.ibm.team.filesystem.FileItem"
      },
      "before": null,
      "after": "_Ngn9CyJeEeG25dOp_iUerQ",
      "internalId": "_NhCzwSJeEeG25dOp_iUerQ"
    }
  ],
  "comment": "",
  "lastUpdatedDate": "2011-12-09T12:06:52.266Z",
  "active": false,
  "owner": {
    "uri": "itemOid\/com.ibm.team.repository.Contributor\/_hhbosPC1EeCsJbI2ZgPDog",
    "itemId": "_hhbosPC1EeCsJbI2ZgPDog",
    "com.ibm.team.repository.typeName": "com.ibm.team.repository.Contributor"
  },
  "com.ibm.team.repository.typeName": "com.ibm.team.scm.ChangeSet",
  "stateId": "_R7C54SJeEeG25dOp_iUerQ",
  "component": {
    "uri": "itemOid\/com.ibm.team.scm.Component\/_auolkPC9EeCek69P-ztT9w",
    "itemId": "_auolkPC9EeCek69P-ztT9w",
    "com.ibm.team.repository.typeName": "com.ibm.team.scm.Component"
  },
  "contextId": "_Dp6kMdwTEd2jUupDpQV1Rw",
  "predecessor": "_NhCzwiJeEeG25dOp_iUerQ",
  "modified": "2011-12-09T12:06:52.288Z",
  "mergePredecessor": null,
  "uri": "itemOid\/com.ibm.team.scm.ChangeSet\/_Nb_UoCJeEeG25dOp_iUerQ",
  "itemId": "_Nb_UoCJeEeG25dOp_iUerQ",
  "properties": [

  ],
  "modifiedBy": {
    "uri": "itemOid\/com.ibm.team.repository.Contributor\/_hhbosPC1EeCsJbI2ZgPDog",
    "itemId": "_hhbosPC1EeCsJbI2ZgPDog",
    "com.ibm.team.repository.typeName": "com.ibm.team.repository.Contributor"
  },
  "xComponentLink": null,
  "etag": "_R7C54SJeEeG25dOp_iUerQ"
}

现在我想查找源代码文件以及更改。但是我怎么能这样做呢?当我尝试将HTTP Get发送到列表中的uri更改时,我收到错误请求400错误。我该怎么办?

1 个答案:

答案 0 :(得分:3)

您呼叫的其他呼叫可能不是API - 使用它需要您自担风险。格式很可能在将来发生变化。 我假设您在使用源代码管理Web UI时发现了该休息调用。您可以转到历史记录视图,查看更改,转到之后或之前的状态。这会将您带到状态视图。右键单击下载链接。这是获取获取与更改集中的更改中引用的特定状态关联的内容所需的URI的一种方法。这应该让你顺利。