It's all about the answers!

Ask a question

How to get project area details for a changeset rtc java-api


Dinesh Senthilvel (132) | asked Dec 05 '22, 4:36 a.m.

 I need to get the project area details like project area name or project area uuid in which the changeset belongs.

I could see projectAreaId in the changeset link but not able to the project area id through RTC Java Api.

I have Ilink, IChangeSet, IChangeSetHandle

Thanks in advance

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Dec 05 '22, 4:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Dec 05 '22, 4:58 a.m.

 As far as I can tell, there is no direct relationship between a change set and a project area in EWM. 

It is absolutely possible to access the same change set in several project areas. So it is unclear what you want to achieve with this information, that is not really provided or available. 

It would be possible to access the project area context in an operation e.g. during a deliver in a pre condition or follow up action.

The interface IChangeSet provides you with the component the change set belongs to. The component is owned by a user or a project area. In the latter case, you can access said project area. Components are selected in streams and streams are owned by a project area, which might be another relationship. Please note that the stream does not have to be in the same project area (owned by) as the component(s).

Dinesh Senthilvel selected this answer as the correct answer

Comments
Dinesh Senthilvel commented Dec 05 '22, 5:14 a.m.
The task was to take all the task workitem changeset and its file content as well as full path of every file.

From task workitem am able to fetch changeset links
From changeset links i will be able to get the file content
But for the full path always i need a configuration

To get the configuration i use below code -> which takes more time so i thought i can provide some more criterias for example "projectarea name" (exact owner name) -- now how can i fetch project area name from changeset handle or ichangeset - can you please let me know.

or any other way how can i get the full path - without a performance hit

Dinesh Senthilvel commented Dec 05 '22, 5:15 a.m.
IWorkspaceSearchCriteria criteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
        criteria.setKind(IWorkspaceSearchCriteria.STREAMS);
        List<IWorkspaceHandle> workspaceHandles = workspaceManager.findWorkspacesContainingChangeset(csHandle, criteria,  Integer.MAX_VALUE, monitor);
try {
            IConfiguration configuration = null;
            for(IWorkspaceHandle workspaceHandle: workspaceHandles){
                IWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandle, monitor);
                    configuration = workspaceConnection.configuration(changeSet.getComponent());
            return configuration;





Ralph Schoon commented Dec 05 '22, 5:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

You could limit the search to Workspace Connections owned by/visible to one project area if you wanted. The search would then not show the ones owned by/visible to other project areas. 

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.