-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateUpdateDefect.cs
32 lines (29 loc) · 1.18 KB
/
createUpdateDefect.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rally.RestApi;
using Rally.RestApi.Response;
namespace aRESTcreateDefect
{
class Program
{
static void Main(string[] args)
{
RallyRestApi restApi = new RallyRestApi("user@co.com", "secret", "https://rally1.rallydev.com", "v2.0");
String workspaceRef = "/workspace/11111"; //use valid workspace OID in your Rally
String projectRef = "/project/12345"; //use valid project OID in your Rally
String userRef = "/user/777";
DynamicJsonObject d = new DynamicJsonObject();
d["Name"] = "some bug";
d["Project"] = projectRef;
d["Owner"] = userRef;
CreateResult createResult = restApi.Create(workspaceRef, "Defect", d);
DynamicJsonObject defect = restApi.GetByReference(createResult.Reference, "FormattedID");
Console.WriteLine(defect["FormattedID"]);
//update defect
defect["Description"] = "bad bug";
OperationResult updateResult = restApi.Update(defect["_ref"], defect);
}
}
}