It's all about the answers!

Ask a question

How to import Work Items in batch ?


Eric Vigneron (1132) | asked Jun 21 '10, 7:39 a.m.
I looking for a way to import WI in command line (batch).
Someone can help me ?

Thank you.
Eric

6 answers



permanent link
Ralph Schoon (63.7k33648) | answered Jun 22 '10, 4:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Eric,

I can think of the following approaches:

1. You can use OSLC http://www.open-services.net and PERL or CURL for scripting. Please search in the forum http://jazz.net/forums/viewforum.php?f=2 and the Team Wiki for example code.
2. You can use the Plain Java API https://jazz.net/downloads/rational-team-concert/releases/2.0.0.2iFix3/JazzPlainJavaClient-2.0.0.2iFix3.zip and write some importer java classes. One of the snippets shipped with the zip shows an example.
3. You can write an importer using the Synchronizer API http://jazz.net/wiki/bin/view/Main/RtcSdk20

1 Is the preferred way, looking into the future, I think.


Ralph

I looking for a way to import WI in command line (batch).
Someone can help me ?

Thank you.
Eric

permanent link
Mark Ingebretson (58515236) | answered Jul 21 '10, 9:06 a.m.
The Eclipse client built-in CSV import works great for this.

http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.workitem.doc/topics/t_importing_work_items_csv_file.html

Export some work items with the columns you want, examine the format,
create your new data, and import. Don't forget to create a column for
Created By so it doesn't use the ID of the person running the import,
and be careful to fully specify the /timeline/iteration in the Planned
For column.

Mark
On 6/21/10 6:53 AM, vigneric wrote:
I looking for a way to import WI in command line (batch).
Someone can help me ?

Thank you.
Eric

permanent link
Dr. Hans-Joachim Pross (1.1k4458) | answered Mar 30 '11, 4:37 p.m.
JAZZ DEVELOPER
... You can use OSLC http://www.open-services.net and PERL or CURL for scripting. Please search in the forum http://jazz.net/forums/viewforum.php?f=2 and the Team Wiki for example code....

Have'nt found a matching example. Might you pls. give a more specific hint? Preferred a Perl example.

permanent link
Ralph Schoon (63.7k33648) | answered Mar 31 '11, 1:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
HaJo,

There is information on the WiKi how to use Eclipse extensions or Plain Java API code to create a work item with attributes. I have no example for OSLC.

Ralph

... You can use OSLC http://www.open-services.net and PERL or CURL for scripting. Please search in the forum http://jazz.net/forums/viewforum.php?f=2 and the Team Wiki for example code....

Have'nt found a matching example. Might you pls. give a more specific hint? Preferred a Perl example.

permanent link
Dr. Hans-Joachim Pross (1.1k4458) | answered Mar 31 '11, 4:41 a.m.
JAZZ DEVELOPER
...There is information on the WiKi how to use Eclipse extensions or Plain Java API code to create a work item with attributes. I have no example for OSLC....

Eclipse extension is nothing for a batch.

To safe the time for others who are searching: Here is a link to Programmatic Creation of Work Items which is for SDK 1.0.
Unfortunately, that does not solve my problem, too. Only for RTC 1.0 & 2.0 and only for creation and not updating...

Beside that, Ive figured out, that at least for the csv-Importer there is no batch support.

permanent link
Ralph Schoon (63.7k33648) | answered Mar 31 '11, 5:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
HaJo,

there is a different forum for this kind of extensibility questions.

You can update work items using CSV import, provided you provide the work item id.

Code that worked for me to programmatically update in the past :

IProgressMonitor monitor = new NullProgressMonitor();
IWorkItemClient workItemService = (IWorkItemClient) targetRepository.getClientLibrary(IWorkItemClient.class);
IWorkItemHandle handle = workItemService.getWorkItemWorkingCopyManager().connectNew(mappedInternalWorkItemType, monitor);
WorkItemWorkingCopy wc = workItemService.getWorkItemWorkingCopyManager().getWorkingCopy(handle);
IWorkItem workItem = wc.getWorkItem();
try {
workItem.setValue(newAttribute, sFId);
} catch (RuntimeException e) {
}
IDetailedStatus s = wc.save(monitor);
if (!s.isOK()) {
throw new TeamRepositoryException("Error saving work item",s.getException());
}
} finally {
workItemService.getWorkItemWorkingCopyManager().disconnect(workItem);
}



and it is usable with a plain java api class as well as in Eclipse.

Ralph

...There is information on the WiKi how to use Eclipse extensions or Plain Java API code to create a work item with attributes. I have no example for OSLC....

Eclipse extension is nothing for a batch.

To safe the time for others who are searching: Here is a link to Programmatic Creation of Work Items which is for SDK 1.0.
Unfortunately, that does not solve my problem, too. Only for RTC 1.0 & 2.0 and only for creation and not updating...

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.