Karthi Ramasubbu
Karthi Ramasubbu

Reputation: 21

Create a Project in the defined workspace using Rally Java RestAPI

I’m trying to use the Rally Java REST API - https://github.com/RallyTools/RallyRestToolkitForJava. How can I create a new project in my defined workspace? I am not able to find anything useful, any help would be much appreciated.

By referring the documentation, i tried the below code, but the project is not created in the Rally

RallyRestApi rallyService = new RallyRestApi(new URI(rallyURL), userName, password);
rallyService.setApplicationName("RallyRestExample");
rallyService.setWsapiVersion("v2.0");

JsonObject newProject = new JsonObject();
newProject.addProperty("Name", "Rally Rest Sample");
newProject.addProperty("Description", "Java Rally Rest API");
newProject.addProperty("State", "Open");
newProject.addProperty("Owner", "Karthi");
newProject.addProperty("Workspace", "/workspace/XXX");

CreateRequest createRequest = new CreateRequest("Project", newProject);
CreateResponse createResponse = rallyService.create(createRequest); 

Thanks Karthi

Upvotes: 1

Views: 954

Answers (2)

Nithyananth
Nithyananth

Reputation: 347

I think you should not use the property newProject.addProperty("Workspace", "/workspace/XXX"); and newProject.addProperty("Owner", "Karthi"); with values like "/workspace/XXX" and "Karthi". Instead you need to provide it with the object ID of respective workspace and owner.

Upvotes: 0

Zack
Zack

Reputation: 5148

There is a user guide in GitHub here. This walks you through how to set up a project and how to use methods provided to you by the API.

There is also full API Documentation here.

On the GitHub page, it also gives you a link to the Web Services API documentation, but you will need a Rally login to view this.

  • Create a new Java Project
  • Make sure you have all the required jars (listed in the documentation) in the Java Project
  • Add the rally-rest-api dependency into your pom.xml (steps listed in documentation)
  • Instantiate a new RallyRestAPI object by using...
RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"), "[email protected]", "password");

Then use restApito use the provided methods from the documentation.

Upvotes: 2

Related Questions