2013-08-26 11 views

답변

0

웹 링크 유형 필드는 LinkID와 DisplayString의 두 부분으로 구성됩니다. 화면 캡처에서 변수 $ {id}에 해당하는 LinkID를 설정하려면 DisplayString도 빈 문자열로 설정해야합니다.

다음은 Rally .NET REST 툴킷을 사용하는 전체 코드 예제입니다. 이 브라우저의 REST 클라이언트를 사용하여 신청의 웹 링크 형식의 linkID를 설정의보다 일반적인 예는 다른 아니라고

using System; 
using System.Collections.Generic; 
using System.Collections; 
using System.Linq; 
using System.Text; 
using Rally.RestApi; 
using Rally.RestApi.Response; 

namespace aRestApp_CollectionOfTasks 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      //Initialize the REST API 
      RallyRestApi restApi; 
      restApi = new RallyRestApi("[email protected]", "secret", "https://rally1.rallydev.com", "v2.0"); 

      //Set our Workspace and Project scopings 
      String workspaceRef = "/workspace/1111"; //please replace this OID with an OID of your workspace 
      String projectRef = "/project/2222";  //please replace this OID with an OID of your project 
      bool projectScopingUp = false; 
      bool projectScopingDown = true; 

      Request storyRequest = new Request("Defect"); 


      storyRequest.Workspace = workspaceRef; 
      storyRequest.Project = projectRef; 
      storyRequest.ProjectScopeUp = projectScopingUp; 
      storyRequest.ProjectScopeDown = projectScopingDown; 

      storyRequest.Fetch = new List<string>() 
       { 
        "Name", 
        "_ref", 
        "c_JiraLink" 
       }; 

      storyRequest.Query = new Query("FormattedID", Query.Operator.Equals, "DE170");  
      QueryResult queryStoryResults = restApi.Query(storyRequest); 

      foreach (var s in queryStoryResults.Results) 
      { 
       Console.WriteLine(" Name: " + s["Name"] + " JiraLink's DisplayString: " + s["c_JiraLink"]["DisplayString"] + " JiraLink's LinkID: " + s["c_JiraLink"]["LinkID"]); 
       DynamicJsonObject toUpdate = new DynamicJsonObject(); 
       DynamicJsonObject myLink = new DynamicJsonObject(); 
       myLink["LinkID"] = "NM-3"; 
       myLink["DisplayString"] = ""; 
       toUpdate["c_JiraLink"] = myLink; 

       OperationResult updateResult = restApi.Update(s["_ref"], toUpdate); 
      } 
     } 
    } 
} 

방법 :. POST

URL :

https://rally1.rallydev.com/slm/webservice/v2.0/defect/3807704995?key=abc123...

요청 본문 :

{ 
"defect": 
{ 
"c_JiraLink":{ 
"DisplayString":"", 
"LinkID":"NM-2" 
} 
} 
} 
관련 문제