Creation and deletion of RTC work item tags witn API
Could somebody help me with API for creation and deletion the tags in Rational Team Concert? Is it possible?
I'm wondering for any information about API both at the server side in a typical follow-up action extension and with REST API.
Thank you very much in advance for any recommendations and references!
Accepted answer
IWorkItem workItem = workingCopy.getWorkItem(); ListIn the REST API I would expect you have to just add a new tag to the list and save the resource with all the data.tags = workItem.getTags2(); tags.add("NewTag"); workItem.setTags2(tags);
I have not tested the code, but it is analogue to several other cases. You would save the work item with the usual means e.g. using the operation pattern or work item save on client or server.
Comments
As for REST API, I was able to successfully update a work item with tags. Next, I put the excerpts from log:
Started updating a workitem with ID=130
Sending HTTP request to server:
Method: PUT
URL: https://<SERVER_NAME>:9443/ccm/oslc/workitems/130?oslc_cm.properties=dc:title,dc:subject
Headers: [Content-type=application/x-oslc-cm-change-request+xml, Accept=application/x-oslc-cm-change-request+xml]
Data: <?xml version="1.0" encoding="UTF-8"?>
<oslc_cm:changeRequests xmlns:oslc_cm="http://open-services.net/xmlns/cm/1.0/" xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/" xmlns:dc="http://purl.org/dc/terms/" xmlns:jp="http://jazz.net/xmlns/prod/jazz/presentation/1.0/" xmlns:jd="http://jazz.net/xmlns/prod/jazz/discovery/1.0/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:rtc_cm="http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/">
<dc:title>defect 12345</dc:title>
<dc:subject>123, 234, 567</dc:subject>
</oslc_cm:changeRequests>
Response code is: 200