It's all about the answers!

Ask a question

how to check whether the user is archived on server side


Surender Biyyala (403548) | asked Jun 27 '14, 4:03 a.m.
 Hi 
The following is my scenario 

Defect nneds to be re assigned to the creator of the defect when the defect is set to implemented.

My problem is what if the user is archived?
I just want to show information for the developer that the user is archived and assign it to someone else.

for this I need to know whether the user is archived or not.

I use the following code .

workItem.getCreator();

now I have the creator but there is no method to find out whether he is archived.

Thanks
Surender

2 answers



permanent link
Surender Biyyala (403548) | answered Jun 27 '14, 7:19 a.m.
  The following is the code to know whether the user is archived or not on the server side.
 public void run(AdvisableOperation operation,
                    IProcessConfigurationElement participantConfig,
                    IParticipantInfoCollector collector,
                    IProgressMonitor monitor) throws TeamRepositoryException
    {
IRepositoryItemService itemService ;

 if (itemService == null)
        {
            itemService = getService(IRepositoryItemService.class);
        }

//code to get the workitem reference

 IContributorHandle contributorHandle1 = workItem.getCreator();
  IContributor contributor = (IContributor)itemService.fetchItem(contributorHandle1, null);

if(contributor .isArchievd()) {

System.out.println("Creator of the workitem is archived");
}


permanent link
Rohit Balduwa (945511) | answered Jun 27 '14, 4:11 a.m.
Hi Surender

For the user perspective to verify whether user is active or inactive, you can follow the below approach.

Please ask the user to login in to the web client.
If the userID is archived, the user will get the below error:
The user xxxx is not authorized to access Jazz Team Server Admin UI.
CRJAZ2611E The user "xxxx" is archived.

If archived, ask the administrator to unarchive the userID.
Let me know if this helps.

Regards,
Rohit


Comments
Surender Biyyala commented Jun 27 '14, 4:17 a.m.

 I want this to do at the code level. For the scenario I explained above.

I have written a follow-up action and when the defect is set to implemented state the plugin gets called and I`m getting the creator of the workitem and setting this value to Owned By attribute. 

So before doing this i need to check whether the user is archived or not and this should happen on the server side.

I know how to do this using client API.

Thanks
Surender

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.