我一直需要找到我们可以解雇的API来关闭不同类型的资产。故事就是其中之一。
我检查了故事是否可以被API关闭或删除。
XML Response:
<?xml version="1.0" encoding="UTF-8"?>
-<Assets pageStart="0" pageSize="2147483647" total="1">-<Asset id="Story:2601366" href="/VersionOne/rest-1.v1/Data/Story/2601366"><Attribute name="Name">OAPHRP --> OAPFND 11/3-11/4</Attribute><Attribute name="IsDeletable">true</Attribute><Attribute name="CheckQuickClose">true</Attribute></Asset></Assets>
基于此,我可以删除/快速关闭故事。所以我解雇了一个。
不幸的是,它没有做任何事情。我试图快速关闭,然后我试图关闭。在这两种情况下,我都得到了如下答案:
XMLResponse for Delete:
<xml>version="1.0" encoding="UTF-8"?>
-<Asset href="/VersionOne/rest-1.oauth.v1/Data/Story/2601366" id="Story:2601366"><Attribute name="AssetType">Story</Attribute><Attribute name="Benefits"/><Relation name="SplitFrom"/>-<Relation name="SecurityScope"><Asset href="/VersionOne/rest-1.oauth.v1/Data/Scope/2129369" idref="Scope:2129369"/></Relation>-<Relation name="Super"><Asset href="/VersionOne/rest-1.oauth.v1/Data/Epic/2814883" idref="Epic:2814883"/></Relation><Relation name="Team"/><Relation name="IdentifiedIn"/><Relation name="Parent"/><Relation name="Category"/><Relation name="Risk"/><Relation name="Customer"/><Relation name="Source"/><Relation name="Priority"/>-<Relation name="Status"><Asset href="/VersionOne/rest-1.oauth.v1/Data/StoryStatus/137" idref="StoryStatus:137"/></Relation>-<Relation name="Timebox"><Asset href="/VersionOne/rest-1.oauth.v1/Data/Timebox/2626276" idref="Timebox:2626276"/></Relation>-<Relation name="Scope"><Asset href="/VersionOne/rest-1.oauth.v1/Data/Scope/2129369" idref="Scope:2129369"/></Relation><Attribute name="Number">B-262556</Attribute><Attribute name="LastVersion"/><Attribute name="OriginalEstimate">1</Attribute><Attribute name="RequestedBy"/><Attribute name="Value"/><Attribute name="Order">-791022846</Attribute><Attribute name="Estimate">1</Attribute><Attribute name="Reference"/><Attribute name="ToDo"/><Attribute name="DetailEstimate"/><Attribute name="Description"/><Attribute name="Name">OAPHRP --> OAPFND 11/3-11/4</Attribute><Attribute name="AssetState">64</Attribute><Attribute name="SplitFrom.Name"/><Attribute name="SplitFrom.Number"/><Attribute name="SecurityScope.Name">Apps DBA M/S 1</Attribute><Attribute name="Super.Name">Cloning</Attribute><Attribute name="Super.Number">E-08725</Attribute><Attribute name="Team.Name"/><Attribute name="IdentifiedIn.Name"/><Attribute name="Parent.Name"/><Attribute name="Parent.Number"/><Attribute name="Category.Name"/><Attribute name="Risk.Name"/><Attribute name="Customer.Name"/><Attribute name="Customer.Nickname"/><Attribute name="Source.Name"/><Attribute name="Priority.Name"/><Attribute name="Status.Name">Accepted</Attribute><Attribute name="Timebox.Name">Sprint 24 (11/3 - 11/14)</Attribute><Attribute name="Scope.Name">Apps DBA M/S 1</Attribute><Attribute name="Ideas"/><Relation name="CompletedInBuildRuns"/><Attribute name="CompletedInBuildRuns.Name"/>-<Relation name="Owners"><Asset href="/VersionOne/rest-1.oauth.v1/Data/Member/1610365" idref="Member:1610365"/></Relation>-<Attribute name="Owners.Name"><Value>Brandon Hill</Value></Attribute>-<Attribute name="Owners.Nickname"><Value>Brandon Hill</Value></Attribute></Asset>
我做错了什么?
答案 0 :(得分:0)
您正尝试将这些网址输入浏览器。这里的欺骗是你从最后的每个URL“op = keyword”得到结果。如果您输入op = GumbyDammit或其他任何内容,您将继续获得相同的结果,即查询单个故事,标识符为2601366.为什么?解析
的API代码 http://test-versionone.XXXXX.com/VersionOne/rest-1.oauth.v1/Data/Story/2601366?op=Delete
模式未将此识别为合法的VersionOne查询模式,截断
?op=Delete
并且仅处理子集
http://test-versionone.XXXXX.com/VersionOne/rest-1.oauth.v1/Data/Story/2601366
这是一个简单的查询。你要做的是将一个空的有效负载http发送到http://test-versionone.XXXXX.com/VersionOne/rest-1.oauth.v1/Data/Story/2601366?op=Delete
。
总之,您只能在浏览器中读取VersionOne数据。必须将所有其他操作发布到数据端点。