0

I created user-define field in UserStory with type "weblink". I see this field in "Custom" section. I wrote next code for update this field.

        QueryRequest storyRequest = new QueryRequest("HierarchicalRequirement");

        storyRequest.setFetch(new Fetch("TestRailsRef"));
        storyRequest.setQueryFilter(new QueryFilter("FormattedID", "=", "US1"));

        QueryResponse storyQueryResponse = restApi.query(storyRequest);

        JsonObject storyJsonObject = storyQueryResponse.getResults().get(0).getAsJsonObject();

        String storyRef = storyJsonObject.get("_ref").getAsString();

        JsonObject updatedDefect = new JsonObject();
        updatedDefect.addProperty("LinkID", "280");
        updatedDefect.addProperty("DisplayString", "Link to TestRails");
        JsonObject updatedTestRailRef = new JsonObject();
        updatedTestRailRef.add("c_TestRailsRef", updatedDefect);
        UpdateRequest updateRequest = new UpdateRequest(storyRef, updatedDefect);
        UpdateResponse updateResponse = restApi.update(updateRequest);

I see warning in updateResponse

"{"OperationResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": ["It is no longer necessary to append \".js\" to WSAPI resources.", "Ignored JSON element hierarchicalrequirement.LinkID during processing of this request.", "Ignored JSON element hierarchicalrequirement.DisplayString during processing of this request."]

WHY?

4

1 回答 1

0

WebLink 类型字段由两部分组成:LinkID 和 DisplayString。为了设置 LinkID,DisplayString 需要设置为空字符串。

也许这篇文章会有所帮助。

于 2013-10-30T20:27:29.370 回答