RallyRestApiAddToCollection Method |
Add items to a collection
Namespace: Rally.RestApiAssembly: Rally.RestApi (in Rally.RestApi.dll) Version: 3.1.1.0 (3.1.1.0)
Syntax public OperationResult AddToCollection(
string itemRef,
string collectionName,
List<DynamicJsonObject> items,
NameValueCollection parameters
)
Public Function AddToCollection (
itemRef As String,
collectionName As String,
items As List(Of DynamicJsonObject),
parameters As NameValueCollection
) As OperationResult
public:
OperationResult^ AddToCollection(
String^ itemRef,
String^ collectionName,
List<DynamicJsonObject^>^ items,
NameValueCollection^ parameters
)
member AddToCollection :
itemRef : string *
collectionName : string *
items : List<DynamicJsonObject> *
parameters : NameValueCollection -> OperationResult
Parameters
- itemRef
- Type: SystemString
The ref of the object to update e.g. /defect/12345 - collectionName
- Type: SystemString
The name of the collection to be updated e.g. Tasks - items
- Type: System.Collections.GenericListDynamicJsonObject
The items to add. These can be references to existing objects or new objects to be created. - parameters
- Type: System.Collections.SpecializedNameValueCollection
additional query string parameters to be included on the request
Return Value
Type:
OperationResultAn
OperationResult describing the status of the request
Examples DynamicJsonObject existingTask = new DynamicJsonObject();
existingTask["_ref"] = "/task/23456";
DynamicJsonObject newTask = new DynamicJsonObject();
newTask["Name"] = "New Task";
NameValueCollection parameters = new NameValueCollection();
parameters["fetch"] = "FormattedID";
List{DynamicJsonObject} newItems = new List{DynamicJsonObject}() { existingTask, newTask };
OperationResult updateResult = restApi.AddToCollection("/defect/12345", "Tasks", newTasks, parameters);
See Also