1

如何使用 Rally Rest API “添加观察者”?我无法在文档中找到任何关键字“watch”、“watcher”或对 watcher 的引用

编辑1:根据约书亚的回答,我尝试了以下方法:

DynamicJsonObject watcherToBeAdded = new DynamicJsonObject();
DynamicJsonObject watcherResult;
watcherToBeAdded["UserUUID"] = User's UUID;
watcherToBeAdded["ArtifactUUID"] = Story's UUID;
watcherToBeAdded["zuul_key"] = rallyAPIKey;
watcherResult = restApi.Post("notifications/watch", watcherToBeAdded);

这导致方法不允许。

我也试过:

string rallyRef = "https://rally1.rallydev.com/notifications/api/v2/watch";
DynamicJsonObject toUpdate = new DynamicJsonObject();
toUpdate["ArtifactUUID"] = StoryUUID;
toUpdate["UserUUID"] = UserUUID;
OperationResult updateResult = restApi.Update(rallyRef, toUpdate);

这引发了以下异常:值不能为空参数名称:键

4

1 回答 1

0

身份验证

所有请求都必须使用有效的 zsessionid 或 Rally API 密钥进行身份验证。您可以通过以下几种方式传递它:

作为标题:zuul=[ZSESSIONID]zuul=[RALLY_API_KEY]

作为 cookie:ZSESSIONID=[ZSESSIONID]ZSESSIONID=[RALLY_API_KEY]

作为查询参数:zuul_key=[ZSESSIONID]zuul_key=[RALLY_API_KEY]

要添加“手表”,您可以发送如下请求:

Method: POST
Url:    https://rally1.rallydev.com/notifications/api/v2/watch
Body: 
{
  UserUUID: <ObjectUUID of user to be added as watcher,
  ArtifactUUID: <ObjectUUID of artifact to be watched>
}

要删除手表,您可以发送如下请求:

Method: DELETE
URL: https://rally1.rallydev.com/notifications/api/v2/watch?ArtifactUUID=<ObjectUUID of artifact>&UserUUID=<ObjectUUID of User to remove as watcher>
于 2017-06-02T19:29:16.333 回答