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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Method getProject("XX") returns statusCode=Optional.absent() Edited

I am using jrjc to connect to jira cloud and fetch project details in my java code. I am able to fetch project details and all projects via *postman* but not in my code.

Dependencies used in pom:

<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-api</artifactId>
<version>4.0.0</version>
</dependency>

Java code snippet:

JiraRestClient jiraRestClient = new AsynchronousJiraRestClientFactory().createWithBasicHttpAuthentication(URI.create("https://issuite.atlassian.net"),
"pr.soni@cgi.com","hXwhg5Da1Yr22XomZv2x4333");

//Trying to fetch project

jiraRestClient.getProjectClient().getProject("PDAD").get().getVersions()

Error :
RestClientException{statusCode=Optional.absent(), errorCollections=[]}

Log:

14:57:27.804 [http-nio-8090-exec-3] DEBUG c.i.i.helper.JiraServiceHelper - Started constructIssueInput:
14:57:42.353 [http-nio-8090-exec-3] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [/infolink-integration] threw exception [Request processing failed; nested exception is com.infosynergi.infolinkintegration.common.exception.ApplicationException: Failed in getting versions for Project Key ISCH] with root cause
com.infosynergi.infolinkintegration.common.exception.ApplicationException: Failed in getting versions for Project Key ISCH
at com.infosynergi.infolinkintegration.util.JIRAUtils.getProjectVersions(JIRAUtils.java:128)
at com.infosynergi.infolinkintegration.helper.JiraServiceHelper.constructIssueInput(JiraServiceHelper.java:140)
at com.infosynergi.infolinkintegration.service.impl.JIRAServiceImpl.createJiraIssue(JIRAServiceImpl.java:103)
at com.infosynergi.infolinkintegration.facade.impl.InfolinkIntegrationFacadeImpl.notifyJira(InfolinkIntegrationFacadeImpl.java:65)
at com.infosynergi.infolinkintegration.controller.SuperOfficeReceiverController.processRequest(SuperOfficeReceiverController.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)

 

 

Funny part is that I am able to fetch all project data, see code snippet:

jiraClient.getJiraRestClient().getProjectClient().getAllProjects().get();

But  I am unable to fetch data this way:

jiraRestClient.getProjectClient().getProject("PDAD").get()

 

In Postman:

Get request in postman: https://issuite.atlassian.net/rest/api/latest/project/CC
is status:200OK, time:136 ms26.19 KB

Authentication: Basic Authentication
Username: pr.soni@cgi.com
Password: API token generated
link usd to create token: https://id.atlassian.com/manage-profile/security/api-tokens

Also I have added permissions to Browse Projects:
https://issuite.atlassian.net/secure/admin/EditPermissions!default.jspa?schemeId=10004

 

 

Do you have any idea how to resolve this issue?

1 answer

   

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you