本文介绍了使用 Rally Java RestAPI 在定义的工作区中创建一个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Rally Java REST API - https://github.com/RallyTools/RallyRestToolkitForJava.如何在我定义的工作区中创建一个新项目?我找不到任何有用的东西,任何帮助将不胜感激.

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.

通过参考文档,我尝试了以下代码,但该项目未在 Rally 中创建

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); 

谢谢卡蒂

推荐答案

GitHub 中有用户指南 此处.这将引导您了解如何设置项目以及如何使用 API 提供给您的方法.

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.

还有完整的 API 文档此处.

There is also full API Documentation here.

在 GitHub 页面上,它还为您提供了一个指向 Web 服务 API 文档的链接,但您需要登录 Rally 才能查看该文档.

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.

  • 创建一个新的 Java 项目
  • 确保您在 Java 项目中拥有所有必需的 jar(在文档中列出)
  • 将rally-rest-api 依赖项添加到您的pom.xml(文档中列出的步骤)
  • 使用...实例化一个新的 RallyRestAPI 对象
RallyRestApi restApi = new RallyRestApi(new URI("https://rally1.rallydev.com"), "[email protected]", "password");

然后使用 restApi 来使用文档中提供的方法.

Then use restApito use the provided methods from the documentation.

这篇关于使用 Rally Java RestAPI 在定义的工作区中创建一个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 01:51