How to get all Change Request of a User, in all projects?


Is it possible to somehow get all Change Request items assigned to a given user, for all server projects? And for a specific project (assuming that if it cannot be done for all projects at the same time, I'll have to populate the list project by project)?

I'm a very newbie on SDK, so if you could provide me with some sample code, I'll be much appreciated! =)



  • Verified Answer

    No, it's not possible to get ChangeReqests across all projects.

    StarTeam follows a container driven architecture.

    The server contains projects.

    Projects contain views.

    Views contain folders.

    Folders contain Items, including files, change requests, tasks, etc.

    You can query a view for all it's change requests, but bear in mind that a projects can contain multiple views.

    so, here's some brute force pseudo-code, based on the com.starteam namespace of the java SDK (the latest public release).

    If you aren't on this build, I'd recommend upgrading - you can download it from microfocus supportline.

    Server s = new Server("host", port);

    s.logon("user", "password");

    ChangeRequest.Type crTyp = s.getTypes().CHANGE_REQUEST;

    PropertyCollection pc = new PropertyCollection();


    for each (Project p in s.getProjects()) {

     for each (View v in p.getViews()) {

        ViewMemberCollection vmc = v.getViewMembers(s.getTypes().CHANGE_REQUEST);


       ChangeRequest[] cc = (ChangeRequest[])vmc.toArray(new ChangeRequest[0]));

       for each (ChangeRequest cr in cc) {

         // find the cr's assigned to a particular user and do something with them

         if (cr.getResponsibility().getName().equals("the responsible user i want"))

           // do something






    As indicated, this is the brute force or heavy handed approach.

    This code will open each project on the server, load all cr's in each view, then release them when done.

    (a non-programming equivalent to this would be the use of the command line )

    java -jar stcmdex.jar select * from change-request where responsibility = "The responsible user i want" -p "user:password@host:port/projectname/viewname"

    possibly driven via a batch script which identifies project names using list-projects & view names using list-views.

    A lightweight approach involves using the lightweight listener event interface, register for all events for all projects & views across the server, then wait for events to come over, and process the interesting ones.

    This approach typically fits a back office service model, where a constantly running process simply processes lightweight events as they come over, without necessarily loading data on the server or in the client.

    Yet another approach is to use the out of the box notification agent service (a StarTeam product) and register for notifications for all projects and views.

    >>I'm a very newbie on SDK

    I'd suggest rectifying this as quickly as you can. :)

    There's a trove of information on this forum and the associated wiki pages,

    including zipped up javadoc for download, a few samples, the source code of the SDK test suite,

    and several SDK topics of interest.

    I hope this all helps.

  • Thank you very much Anil, this all helped me a LOT! :)

    I'll also try the lightweight approach, using the listener event interface you mentioned.