Is it possible to change iteration data through REST API?
Hi!
We have an RSA extension that uses the Rest API to synchronize with an RTC project area (RTC 3.0) . Getting and updating ordinary work items like defects works as expected. For iterations it possible to do a GET request to get data from an iteration, for example like this:
https://localhost:9443/ccm/oslc/iterations/_dyM1gEsYEeG_mqkOQUVnDA
However, trying to do a PUT request to replace some of the values we get a 405 Method Not Allowed Response. Now we are trying to find out if we just have made any faults in our request, or if it simply is not possible.
Should it be possible to update iteration date like start/end-date through the REST API?
with best regards Erik
We have an RSA extension that uses the Rest API to synchronize with an RTC project area (RTC 3.0) . Getting and updating ordinary work items like defects works as expected. For iterations it possible to do a GET request to get data from an iteration, for example like this:
https://localhost:9443/ccm/oslc/iterations/_dyM1gEsYEeG_mqkOQUVnDA
However, trying to do a PUT request to replace some of the values we get a 405 Method Not Allowed Response. Now we are trying to find out if we just have made any faults in our request, or if it simply is not possible.
Should it be possible to update iteration date like start/end-date through the REST API?
with best regards Erik
3 answers
Thanks!
We managed to change the iteration data through the Java API
br Erik
We managed to change the iteration data through the Java API
br Erik
Comments
can you send me an example?
Has been on vacation, but the following lines could give you some clues. It is actually quite straightforward when you have a valid ITeamRepository reference. Then you can fetch the wanted project area and from that timelines and from that iterations, and then you can do whatever you want with them.
br Erik
processItemService =(IProcessItemService)teamRepository.getClientLibrary(IProcessItemService.class);
...
private void updateIteration(IIteration iteration, String id, String name, Date startDate, Date endDate) throws RTCException{
try{
Date date = iteration.getEndDate();
IIteration iterationCopy =
(IIteration)processItemService.getMutableCopy(iteration);
iterationCopy.setEndDate(endDate);
iterationCopy.setStartDate(startDate);
iterationCopy.setName(name);
IProcessItem[] itemsToSave =
new IProcessItem[]{iterationCopy};
IProcessItem[] savedItems =
processItemService.save(itemsToSave, new NullProgressMonitor());
}
catch (Exception e){
<something>
}
}
Hmmm, the formatting above became quite lousy, seems that line breaks are ignored :-(