It's all about the answers!

Ask a question

Change the status of a workitem approval using the Rational Team Concer REST services


Carlos Flores (112) | asked Nov 25 '13, 7:56 p.m.
edited Nov 25 '13, 8:00 p.m.
 Hi All:

Is it possible to change the status of a workitem approval using the  Rational Team Concert REST services? If it's possible, Anyone could help me with command syntax required to query and modify the states of approvals of a workitem in specific?


Thanks in Advance

One answer



permanent link
Joao Bosco Jares A. Chaves (324813) | answered Jan 23 '14, 1:45 p.m.
sure look the source below:


private void atualizarIncidenteVoltarInvestigacao(MSG008TO msg008to,String incidenteRecuperadoXML, String idNovoIncidente) {
    try{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc=builder.parse(new InputSource(new StringReader(incidenteRecuperadoXML)));
Node elementIsUsd = doc.getElementsByTagName("dcterms:description").item(0);
elementIsUsd.setTextContent(""+elementIsUsd.getTextContent()+""+msg008to.getDescription());
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
   transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
DOMSource source = new DOMSource(doc);
StringWriter stringWriter = new StringWriter();
StreamResult result = new StreamResult(stringWriter);
transformer.transform(source, result);
String xml = stringWriter.toString();
String putQuery = "https://"+host+"/ccm/oslc/workitems/"+idNovoIncidente+".xml?_action=FluxoIncidentes.action.a9";        
HttpResponse responsePut = BNBRestUtil.getPutResponseRdfXmlOslc(putQuery, cookieStore, xml);
int statusCode = responsePut.getStatusLine().getStatusCode();
if (statusCode != 200) {
throw new RuntimeException("Falha ao realizar chamada de atualizacao do wi incidente.");
}
}catch(Exception e){
throw new RuntimeException(e.getMessage(),e);
}
}

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.