There was an error in this gadget

Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 10 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD

Followers

Saturday, March 15, 2014

How to get User Subscription details from Rally




//Below code gives the User Details Subscriptions
private JsonObject getSubScriptionResponse() {

                RallyRestApi restApi = new RallyRestApi(new URI(rallyURL),
"user@yourcomapany.com", "password");
QueryRequest subscriptionRequest = new QueryRequest("Subscriptions");
subscriptionRequest.setFetch(new Fetch("Name", "SubscriptionID",
"Workspaces", "Name"));

QueryResponse subscriptionQueryResponse = null;
JsonObject subscriptionQueryObject = null;
try {
subscriptionQueryResponse = restApi.query(subscriptionRequest);
JsonArray subscriptionQueryResults = subscriptionQueryResponse
.getResults();
JsonElement subscriptionQueryElement = subscriptionQueryResults
.get(0);
subscriptionQueryObject = subscriptionQueryElement
.getAsJsonObject();
this.subscriptionId = subscriptionQueryObject.get("SubscriptionID")
.toString();
System.out.println("Read Subscription: " + subscriptionId);
} catch (IOException e) {
e.printStackTrace();
}
return subscriptionQueryObject;

}

No comments:

Post a Comment