Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to archive access groups programmatically

I don't see option to archive multiple access groups at one shot in web client.
We have created several access groups for test purpose which needs to be archived now. Is it possible to do it programmatically?

0 votes



One answer

Permanent link

 Likely Yes. The code below is untested and might not work but could be some kind of stating point.



// Not sure that works
IAccessGroupService accessGroupService = (IAccessGroupService) teamRepository
.getClientLibrary(IAccessGroupService.class);

accessGroup = (IAccessGroup) accessGroup.getWorkingCopy();
//com.ibm.team.process.internal.common.service.IAccessGroupService
accessGroupService.archive(accessGroup);
//accessGroupClientService.archiveAcccessGroup(accessGroup, monitor)
accessGroupClientService.save(accessGroup, monitor);


I know this works:

IAccessGroupClientService accessGroupClientService = (IAccessGroupClientService) teamRepository
.getClientLibrary(IAccessGroupClientService.class);

And you can find accessGroups using IAuditableCommon.

0 votes

Comments

Hi Ralph,

Thanks for the response.

IAccessGroupService accessGroupService = (IAccessGroupService) teamRepository

.getClientLibrary(IAccessGroupService.class);
I am working on a client side application, above code always returns me null. It's not able to fetch proper service object.

While I face some difficulty in getting it working with alternative approach suggested.
accessGroupClientService.archiveAcccessGroup(group, rtcBean.getProgressMonitor()); {Error:  Method is undefined }

 I am using RTC 6.0.2 java libraries. Am I missing something?

 I searched the code and IAccessGroupService is only used in the server API using getService(). If is however the only API I found that allows to archive and delete AccessGroups. I might have overlooked something.


If you set up the development environment with the SDK as explained in the Extensions Workshop, you can search the API. I don't have the time to search the API for you. I spent as much time as I could.

 I had another quick look. The IAccessGroupService is not easily accessible. You can get the IAccessGroupClientService 


IAccessGroupClientService accessGroupClientService = (IAccessGroupClientService) teamRepository
.getClientLibrary(IAccessGroupClientService.class);

Which internally uses IAccessGroupService but does not expose the API to archive and delete access groups. 

You can look up how that class gets the IAccessGroupService and try to get it in a similar way, but it is basically using internal APIs if you achieve that goal.  

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 7,491

Question asked: Feb 22 '17, 2:22 a.m.

Question was seen: 1,246 times

Last updated: Feb 22 '17, 8:18 a.m.

Confirmation Cancel Confirm