Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

cannot find symbol symbol: class ApplicationUsers

MAB March 9, 2017

I am getting this error while building a gadget. I have added a Rest Resource in Gadget and trying to pull all projects which logged in user can see. Following is my Rest Resource code (Code taken from some internet resource)


public Response getProjects(@Context HttpServletRequest request)
{
   String username = userManager.getRemoteUsername(request);

   User user = ApplicationUsers.toDirectoryUser(userUtil.getUser(username));
   Collection<Project> projects =
          permissionManager.getProjectObjects(Permissions.BROWSE, user);

   Collection<ProjectRepresentation> projectRepresentations =
         new LinkedList<ProjectRepresentation>();
    for (Project project : projects)
   {
        projectRepresentations.add(new ProjectRepresentation(project));
   }
   ProjectsRepresentation allProjects =
            new ProjectsRepresentation(projectRepresentations);


   return Response.ok(allProjects).build();
}

 

What can be possible reason? Anyone having idea? or give me some code snippet how can i get the projects. 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2017

ApplicationUsers should be part of the JIRA API. edit: it's part of jira-core. Do you have jira-api jira-core dependency in pom.xml?

MAB March 9, 2017

yes jira-api dependency is already there in pom.xml Any other thing which i need to check.  according to this thread 

https://answers.atlassian.com/questions/31681806 ApplicationUser is deleted. Is that so? if yes what is the way around?

Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 10, 2017

Just checked this for you. For sure it's not deleted and there is a javadoc entry for it: https://docs.atlassian.com/software/jira/docs/api/server/com/atlassian/jira/user/ApplicationUsers.html but it's not part of jira-api. ApplicationUsers belongs to jira-core dependency. For sure you can add it in your pom but it's not recommended to rely on classes from jira-core unless you really know what you are doing and really need.

TAGS
AUG Leaders

Atlassian Community Events