java - Get all work hours from Jira -


i work hours jira. tried code beginning:

import com.atlassian.jira.rest.client.jirarestclient; import com.atlassian.jira.rest.client.nullprogressmonitor; import com.atlassian.jira.rest.client.domain.basicproject; import com.atlassian.jira.rest.client.internal.jersey.jerseyjirarestclientfactory; import java.net.uri;  public class jiraimpl {     private static final string jira_url = "https://jira.atlassian.com";     private static final string jira_admin_username = "test";     private static final string jira_admin_password = "test";      public static void main(string[] args) throws exception     {         jirarestclient jira;         jerseyjirarestclientfactory clientfactory = new jerseyjirarestclientfactory();         jira = clientfactory.createwithbasichttpauthentication(new uri(jira_url),             jira_admin_username, jira_admin_password);         system.out.println("connection established >> " + jira_url);          iterable<basicproject> allprojects = jira.getprojectclient().getallprojects(new nullprogressmonitor());     } } 

but get: caused by: com.sun.jersey.api.client.uniforminterfaceexception: client response status: 401

what proper way projects?

to projects can use componentaccessor.getprojectmanager().getprojectobjects(); return projects ordered name. link docs projectmanager

rest api /rest/api/2/project

baseurl + /rest/api/2/project 

returns projects visible logged in user. if no user logged in, returns list of projects visible when using anonymous access.

api docs link


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -