It's all about the answers!

Ask a question

How do I archive a user using Perl+REST+OSLC?


Cliff Gardiner (921033) | asked May 17 '16, 9:46 a.m.

Hi, I'm writing some utilities in Perl to help manage our CLM 4.0.7 implementation. 

So far I've been able to create work items and now I'm trying to archive users who are no longer present in LDAP and also to report their unresolved work items and their repository workspaces.

I can list the users, see if they're already archived and look up against LDAP, but I'm struggling to understand quite what structure to post to what URL to archive a user.  If anyone can give me a steer I'd be grateful.

Accepted answer


permanent link
Donald Nong (14.5k414) | answered May 18 '16, 2:32 a.m.
I doubt that there is published API to do so. If you really need to do it from a script, you can monitor the network traffic in the browser (Chrome or Firebug) and capture the request (likely an internal API) for archiving a user, then mimic the behavior in your script.
Cliff Gardiner selected this answer as the correct answer

Comments
Cliff Gardiner commented May 18 '16, 3:38 a.m.

Thanks Donald.  If you don't know then I doubt anybody else does.

The idea is that when people leave the company, various objects get left behind and housekeeping those objects presents a challenge.  Anything we can do to automate steps is helpful, but it looks like this particular action won't be possible from a supported API :o(

2 other answers



permanent link
Dibyandu Roy (111) | answered Mar 14 '18, 12:55 a.m.

 Ralph Schoon

How to unarchive the user?
setArchived(true); use for archiving the user.
I have gone through the entire java doc, but didnt find a function to unarhive.
Would you please help here.


Comments
1
Donald Nong commented Mar 14 '18, 2:09 a.m.

Have you tried setArchived(false)?


permanent link
Ralph Schoon (63.1k33645) | answered May 18 '16, 6:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited May 18 '16, 6:04 a.m.
There is a Java Client Library API that could be used. Examples:

https://rsjazz.wordpress.com/2012/10/12/changing-the-jazz-user-id-using-the-rtc-plain-java-client-libraries/
Archiving is pretty much in the same API

Also
https://rsjazz.wordpress.com/2013/01/08/maintaing-user-photos-with-the-plain-java-client-libraries/

In the background, this is using the REST API as well, but there is no published REST API I am aware of.

Comments
Ralph Schoon commented May 18 '16, 6:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

        IContributor user = teamRepository.contributorManager().fetchContributorByUserId(archiveID, monitor);
       
        IContributor archiveIDWorkingCopy = (IContributor) user.getWorkingCopy();
        archiveIDWorkingCopy.setArchived(true);
        teamRepository.contributorManager().saveContributor(archiveIDWorkingCopy, monitor);


Cliff Gardiner commented May 18 '16, 6:14 a.m.

Thanks Ralph.  It's looking increasingly like I will be obliged to use Java to do what I need which is not welcome as we're not all Java programmers.  I guess that's just something else I need to get to grips with!

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.