Created On:  25 October 2011

Problem:

I want to generate a listing of Change Requests (CR) from all Views of a Project and saving the output to a file? How can this be achieved?

Resolution:

The attached Java program, ChangeRequestReport.java, make use of StarTeam Java SDK to export all the CRs from all Views of a Project.

The program works by iterating through each view of the project, and for each view, iterates through all subfolders and their descendants to retrieve the CRs created under the folders. The details of the CR is written to the console as well as to a file named ListOfCR.txt. As a result of this simple implementation, CRs with the same CR number that exist in different views will be displayed more than once.

Follow the steps below to make the necessary changes and to execute it:

1. Extract the zipped file.

2. Use a text editor to modify the following variables to suit your environment
stServerAddress = "10.16.12.5";     //StarTeam Server Address
stServerPort = 49201;                    //StarTeam Server Port
stUserName = "Administrator";       //StarTeam Server User Name
stPassword = "Administrator";        //StarTeam Server Password
stProject = "TestCR";                     //Name of Project

3. Save the changes.

4. Compile and run ChangeRequestReport.java. It will create an output called ListOfCR.txt. This file can be viewed using Microsoft Office Excel.

5. Launch MS Office Excel.

6. Open ListOfCR.txt in Excel.



7. When prompted to choose a file type as shown in the diagram below, select the Delimited option and click Next.



8. For the Delimiters, select the 'Other' option , then type the '|' character in the textfield as shown below:



9. Click Next to proceed to Step 3 of 3. For the Column data format, you may choose an appropriate format to match the column data type for each column.

 

10. After setting the data format for all columns, click Finish.


In Excel, the output will look similar to the screenshot below:

 

In Excel, you have the flexibility of sorting the output using any columns.

If more details are needed, the program ChangeRequestReport.java can be modified accordingly to suit your needs.

Note that this program is provided as a reference to highlight the APIs available for retrieving CR details. This is not a program supported by R&D.
Incident #2536111