It's all about the answers!

Ask a question

How to gel all the project area list within an Advisor


Kurtulus YILDIRIM (68917) | asked Oct 12 '16, 9:38 a.m.
Hi,
I am trying to develop a operation advisor that will check workitem status in a different project area. The problem is I need to search that project area every time my advisor works. I already found IProjectArea.findProcessArea method but it works in client side so I can not use it in an advisor.
Thank you.

Accepted answer


permanent link
Ralph Schoon (62.0k33643) | answered Oct 12 '16, 10:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 12 '16, 11:23 a.m.
I used https://www.google.com/search?q=RTC+API+find+Project+Area+server+site:jazz.net and there where some promising hits.

I'd try https://jazz.net/forum/questions/97543/server-api-to-get-the-project-area and https://jazz.net/forum/questions/78308/how-to-pass-uri-parameter-to-iprocessserverservicefindprocessarea-method and see f that is server API. You can definitely

com.ibm.team.process.service.IProcessServerService.class seems to do the trick. Note, it implements com.ibm.team.process.internal.common.service.IProcessService which has most of the API you want.
Kurtulus YILDIRIM selected this answer as the correct answer

Comments
Kurtulus YILDIRIM commented Oct 13 '16, 12:56 a.m.

As I understand, I need to have full project name but I have only first 6 character which is a unique id for project name.


Kurtulus YILDIRIM commented Oct 13 '16, 4:12 a.m.

I solved it.
                IProcessServerService processService = getService(IProcessServerService.class);

                IContributorHandle user = this.getAuthenticatedContributor();
                IRepositoryItemService itemService = getService(IRepositoryItemService.class);              
                IContributor loggeduser = (IContributor) itemService.fetchItem(user, null);
               
                IProcessArea[] userProjects= processService.findProcessAreas(loggeduser, null, null);

Your answer


Register or to post your answer.