How to find change set(s) submitted for review?
One answer
what you are trying to achieve?
Based on not really understanding your use case, the easiest way to get the work items that are pending approval is using a query. You can do that also using the API. You can also use an Expression that you dynamically create and run that using the API. There are more API examples in the blog that is subject to the links in this answer, that might be interesting for you.
Comments
Hi Ralph,
Thanks for the reply. What exactly I'm trying to achieve is to show the change set(s) submitted for a review in an Eclipse View in the user's RTC Client to which the change set(s) have come for review in a tree view structure. These change sets then could be expanded to show the changed files and then on right click on the file, I want to open the file in a custom editor.
Hi Vinod,
this 'cherry picking' is only partially supported today. You can run a query e.g. recently approved work items. You can then open each work item. You can select the completed change sets associated with the work item and accept them into your loaded repository workspace to cherry pick.
As an alternative, you can use Search->Jazz Source Control->Locate change set.
In the lower section you select your repository workspace. In the upper section you add the work items you are interested in. If you have a parent for all the work items you are interested, you can add that.
You can search which change sets are not in your workspace. For each one you want, you can open it in the change explorer and accept it into your workspace to cherry pick.
Please be aware that you might have created gaps because changesets are not necessarily separated by files and might depend on each other. This will be detected and you will have to deal with it. You can also only accept completed change sets.
As a second thought, you could probably create some kind of automation using the API. This post shows a little bit of the Server API likely to be involved: http://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/
There are other posts on how to use queries and expressions for automation too, for example http://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/
There are some example snippets in the plain java client libraries you can start with. However, this is probably not a small effort.