IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
I'm looking for a way to make a call through the API to query the Starteam DB and have the query return a list of CRs that have a matching value in a Usr_ defined field.
For example, for each CR we have a Usr_ReleaseNumber text field defined for the CR. I would like to send a query that basically says, "Please return a list of CR's that contain Usr_ReleaseNumber equal to "1234". I'd like to see the work done on the database side, rather than have to walk a list of CR's in the folder and interrogate each one to see if it has a matching release number.
Is this something I can do using the ViewMemberListManager? If so, still not sure how to construct the query through the API to return just the relevant CRs.
the simplest query you can write is one using the CommandProcessor class, which encapsulates viewmemberlistmanagers, folderlistmanagers, sorting, querying, filtering etc. a pseudo query would look like this Server s = new Server("host", port); Project p = s.findProject("projectname"); View v = p.findView("viewname); CommandProcessor cp = new CommandProcessor(v); String results = cp.execute("select viewmemberid from changerequest where Usr_ReleaseNumber = "1234""); // do something with the results s.disconnect(); I hope this helps anil
In reply to Anil Peres-da-Silva:
In reply to jlynch:
In reply to mzrousar:
Yes, you can execute any query through the CommandProcessor which is supported by the stcmd/stcmdEx engine. The entire syntax of the select statement is available here community.microfocus.com/.../stql-the-select-command-a-generalized-starteam-query-generation-language You have the flexibility to provide the date format of your choice, per the rules of the grammar (-pattern) in the link above. (though for what its worth, the format is validated using the java SimpleDateFormat pattern matcher) Take care anil
In reply to haqattaqq:
you need to use -pattern (please see the select syntax here) community.microfocus.com/.../stql-the-select-command-a-generalized-starteam-query-generation-language and the pattern syntax here docs.oracle.com/.../SimpleDateFormat.html select viewmemberid from changerequest -pattern 'M/d/y' where Usr_ReleaeNumber = '1234' and ClosedOn geq '12/31/2018' you can test these commands out using stcmd or stcmdex, then integrate them into your java or c# programs. take care anil