It's all about the answers!

Ask a question

Use API to move item from one ProjectArea to another


John Martin (1313) | asked Feb 02 '15, 10:24 p.m.
 I haven't been able to find a way to use the REST API directly to change the project area for a work item from one to another.  I send along either this package:

{ "rtc_cm:projectArea": "New Project Area" }

or

{ "rtc_cm:projectArea": "https://server/ccm/oslc/projectareas/_asdfasdfasdf"}

or 

{ "rtc_cm:projectArea":{ "rdf:resource": "https://server/ccm/oslc/projectareas/_saasdfasd"}}

and none of them actually change the project area, but none offer any error, either.

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Feb 03 '15, 1:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Because work items "live" in a project area and each project area has its own process, you can not just change the project area. You have to create a new work item in another project area and set the values as appropriate for the process that project area uses.

This is the reason why there is actually a move to project area in the tool, that does all this copy/mapping.
John Martin selected this answer as the correct answer

Comments
John Martin commented Feb 03 '15, 8:23 a.m.

Thanks, Ralph.  It's disappointing when the tool can do something that the API won't allow.


Ralph Schoon commented Feb 03 '15, 8:46 a.m. | edited Feb 03 '15, 8:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I did not say the API would not allow to do this. I just meant to say that this is not just changing one work item attribute, as far as I can tell.

Using the API you can basically also create a new work item and copy the data over (and delete the old one). You would have to do all the mapping for all the values needed. It is not trivial but it can definitely be done. If you look into the RTC Eclipse client SDK, you might even be able to find the code that does it. Otherwise https://rsjazz.wordpress.com/2015/01/12/a-rtc-workitem-command-line/ should answer most of the API questions you might have.


Ralph Schoon commented Feb 03 '15, 8:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

With the REST API you would likely have to do a little bit more, e.h. to find the mapping enumeration literals. Not sure, I am not an OSLC/REST expert.


1
Marko Tomljenovic commented Feb 13 '15, 7:54 a.m.

 Hi Ralph,

can I use the command line tool to move a work item from one project area to a different one in the same repository?
If so could you give an example of the command line call.

Sincerely, Marko


Ralph Schoon commented Feb 13 '15, 8:15 a.m. | edited Feb 13 '15, 8:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

As explained in that  blog, you can't.

Special Properties Handling

Some special properties are protected from changing.

  • Work Item ID: can not be changed
  • Project Area: parameter “projectArea” can only be specified when creating the work item. It can not be set to a different value later.

There might be other limitations imposed by the process e.g. against changing the creator of a work item.

However, there are tools that you could use, the action in the tool for one work item or the Bulk Move tools

See https://jazz.net/wiki/bin/view/Main/BulkMoveWorkItemsBetweenProjectAreas

Move really is copying the data, create a new work item in the other PA and assign the data, including a mapping process. The work item commandline currently allows only to create and update work items. There is no copy work items, let alone across project areas at this time.

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.