簡體   English   中英

無法在多值屬性上設置值。 使用版本一API創建Epic資產時,使用AddValue和RemoveValue

[英]Cannot SetValue on Multi-value attribute. Use AddValue and RemoveValue while create an Epic Asset using Version One API

使用版本1 API創建“ Epic”類型的資產時出現錯誤。 這是我的請求網址:

URL:<Domain>/rest-1.v1/Data/Epic

要求正文:

<?xml version="1.0" encoding="UTF-8"?>
<Asset href="<Domain>/rest-1.v1/New/Epic">
    <Attribute name="Name" act="set">Test Epic Creation</Attribute>
    <Relation name="Category">
        <Asset href="<Domain>/rest-1.v1/Data/EpicCategory/207" idref="EpicCategory:207"/>
    </Relation>
    <Attribute name="Category" act="set">EpicCategory:207</Attribute>
    <Attribute name="Status" act="set">EpicStatus:64</Attribute>
    <Attribute name="Custom_Product" act="set">Custom_Product:0</Attribute>
    <Attribute name="Description" act="set">Test Epic Creation</Attribute>
    <Relation name="Scope" act="set">
        <Asset href="<Domain>/rest-1.v1/Data/Scope/189675" idref="Scope:189675" />
    </Relation>
    <Attribute name="StrategicThemes" act="add">
        <Value>StrategicTheme:5158</Value>
   </Attribute>
</Asset>

這是我得到的:

<Error href="<Domain>/rest-1.v1/Data/Epic">
    <Message>Server Error</Message>
    <Exception class="System.NotSupportedException">
        <Message>Cannot SetValue on Multi-value attribute.  Use AddValue and RemoveValue.</Message>
    </Exception>
</Error>

我面臨的問題是設置StrategicThemes屬性的值,該屬性是一個多值屬性。

我被困住了。 請幫助。

這是因為可以將值添加到多值屬性中並且無法設置。 僅為單值屬性設置值。 另外,用於將值添加到StrategicThemes屬性的代碼也不正確。

<Attribute name="StrategicThemes" act="add">
     <Value>StrategicTheme:5158</Value>
</Attribute>

因此有問題的錯誤。

中的多值屬性的值應添加為:

<Relation name="StrategicThemes">
        <Asset idref="StrategicTheme:5158" act="add"/>
</Relation>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM