It's all about the answers!

Ask a question

Is it possible to change iteration data through REST API?


Erik Jägervall (73710) | asked Jan 30 '12, 4:37 a.m.
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

3 answers



permanent link
Sean G Wilbur (87222421) | answered Feb 06 '12, 11:39 a.m.
JAZZ DEVELOPER
These are currently only in DRAFT form and for internal use only, you can see the reference on the wiki.

https://jazz.net/wiki/bin/view/Main/ProcessMain

-Sean

permanent link
Qiong Feng Huang (76911610) | answered Feb 07 '12, 5:41 a.m.
JAZZ DEVELOPER
We don't support modify (PUT/DELETE/POST) iteration through REST API. We only support GET iteration.

https://jazz.net/wiki/bin/view/Main/DraftTeamProcessRestApi

permanent link
Erik Jägervall (73710) | answered Mar 05 '12, 8:39 a.m.
Thanks!

We managed to change the iteration data through the Java API

br Erik

Comments
Rachid Halloul commented Aug 04 '12, 9:08 a.m.

can you send me an example?


Erik Jägervall commented Aug 16 '12, 2:09 a.m.

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>
  }

}


Erik Jägervall commented Aug 16 '12, 2:10 a.m.

Hmmm, the formatting above became quite lousy, seems that line breaks are ignored :-(

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.