It's all about the answers!

Ask a question

RTC REST API to manage Defects


Arvind Sahu (133) | asked Dec 21 '17, 2:07 a.m.

 Hi, We have just started using RTC in one of our client projects. 


We need to be able to use its REST APIs to manage defects, i.e., get details of single or multiple defects, create defects, update defects and so on.

I am searching for online help and documentation but too much material is confusing, and I'm not able to proceed with my design.

Are there examples of how I can achieve my goal? Please let me know how I can use REST API to manipulate defects in my RTC installation.

Thanks

One answer



permanent link
Karthik Krishnan (859396135) | answered Dec 21 '17, 3:54 a.m.

While REST (OSLC) implementation of RTC doesn't support features, it can be used to an extent.


Try out some examples given in https://jazz.net/library/article/635 

This should be a good start.

Once you have specific questions, it is easy to answer.


Comments
Geoffrey Clemm commented Dec 23 '17, 3:15 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Just to check, when you say "REST(OSLC) implementation of RTC doesn't support features", did you mean that not all features of RTC are available through the OSLC API (which is true), or something else?


Arvind Sahu commented Dec 26 '17, 12:16 a.m. | edited Dec 26 '17, 12:17 a.m.

 Hi Karthik krishnan,


I try to get defect and post a defect using rest api.
When i try with postman its working fine.
But while try using java code using jersey rest client, its gives me html page as response.
 
Header values I set as below in the sample code.     
                RestRequest request = new RestRequest();
request.getHeaders().put("Accept", "application/json");
request.getHeaders().put("Authorization", "Basic anlvdGk6anlvdGk=");
request.setBaseUrl("https://192.168.2.222:9443/ccm");
request.setPath("/resource/itemName/com.ibm.team.workitem.WorkItem/2");
request.setMethod("GET");

Response :
status - 200 and below html page
<!DOCTYPE html>
<!--
  Licensed Materials - Property of IBM
  (c) Copyright IBM Corporation 2005, 2015. All Rights Reserved.
  
  Note to U.S. Government Users Restricted Rights:
  Use, duplication or disclosure restricted by GSA ADP Schedule
  Contract with IBM Corp.
-->

<html >
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=10">
<title></title>

<link type="text/css" rel="stylesheet" href="/ccm/web/_style/?include=A~&etag=JLGO3lIcQGU_en_US&_proxyURL=%2Fccm&ss=MEwIR">
<link rel="shortcut icon" href="/ccm/web/net.jazz.ajax/jazz.ico">

<style type="text/css">
#net-jazz-ajax-NoScriptMessage {
width: 100%;
color: #D0D0D0;
font-size: 2em;
text-align: center;
position: absolute;
top: 1%;
z-index: 999;
}
</style>

</head>

<body class="claro">
<noscript><div id="net-jazz-ajax-NoScriptMessage">Javascript is either disabled or not available in your Browser</div></noscript>
<div id="net-jazz-ajax-InitialLoadMessage">Loading...</div>
<div id="net-jazz-ajax-WorkbenchRoot"></div>
<script type="text/javascript">
djConfig = {
isDebug: false,
layout: "",
usePlainJson: true,
baseUrl: "/ccm/web/dojo/",
locale: "en-us",
localizationComplete: true
};
/null/
net = {jazz: {ajax: {}}};
net.jazz.ajax._contextRoot = "/ccm";
net.jazz.ajax._appPath = "/ccm/auth/authrequired";
net.jazz.ajax._webuiPrefix = "/web/";
</script>
<script type="text/javascript" src="/ccm/web/_js/?include=A~&etag=JLGO3lIcQGU_en_US&_proxyURL=%2Fccm&ss=MEwIR&locale=en-us"></script>

<script type="text/javascript">
require("dojo/main").getObject('jazz.core.loader', true)._serverStartup="MEwIR";
require("dojo/main").getObject('jazz.core.loader',true)._loaded=["A"];
</script>

<script type="text/javascript">
/ <![CDATA[ /
dojo.addOnLoad( function() {
net.jazz.ajax.ui.PlatformUI.createAndRunWorkbench("net.jazz.web.app.authrequired");
});
/ ]]> /
</script>
</body>
</html>
 


Thanks.




Leon Sun commented Jan 16 '18, 4:49 p.m. | edited Jan 16 '18, 7:00 p.m.

Hello Karthik,

I try to follow this issue chain to reach you. Can I ask you a question about RTC and OSLC_CM REST API? Let me send this first to test my question.

Leon


Leon Sun commented Jan 16 '18, 4:58 p.m. | edited Jan 16 '18, 7:01 p.m.

Great! It finally works. Ok, here is my question. I'm trying to use Python script to query work items in IBM Rational Team Concert (RTC) 6.0.3. I use Python package rtcclient 0.6.0 to access RTC server. As I know, rtcclient needs OSLC_CM REST API support. For some reason, my query doesn't work so I'm wondering if our RTC 6.0.3 has OSLC_CM REST API. I asked many people including our RTC administrator. So far, nobody can answer my simple question. Could you tell me if RTC 6.0.3 has the OSLC_CM REST API? or how can I find out if it has it? Thank you so much for your help!


Donald Nong commented Jan 16 '18, 7:02 p.m.

Leon, please do not post follow-up questions as answers. You can either open a new post, or make them as comments. For your query, you should find all the answers in the below article.
https://jazz.net/library/article/1001


Leon Sun commented Jan 17 '18, 4:21 p.m. | edited Jan 19 '18, 12:58 p.m.

Donald, sorry for that. I did open a new post two weeks ago and didn't get useful help. Karthik seems to be pretty knowledgeable so I tried to reach him. Thank you for your help!

showing 5 of 6 show 1 more comments

Your answer


Register or to post your answer.