When ever trying to hit the Jira Api's
Getting below response:
JSON Response: {"errorMessages":["Issue does not exist or you do not have permission to see it."],"errors":{}}
Moreover When i directly try to hit the endpoint URL , It works for me.
I have admin access for my user and still getting this error.
Below is the code snippet
public string username ='XXXXXX';
public string password ='XXXXXXXXX';
HTTP h = new HTTP();
HTTPRequest r = new HTTPRequest();
r.setEndpoint('https://wuservicecloud.atlassian.net/rest/api/latest/issue/38281');
System.debug('User name'+username );
System.debug('Password'+password);
Blob headerValue = Blob.valueOf(username+':'+password);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
r.setHeader('Authorization', authorizationHeader);
r.setHeader('Content-Type','application/json');
r.setMethod('GET');
System.debug('authorizationHeader ---->'+authorizationHeader );
HTTPResponse res = h.send(r);
System.debug('JSON Response: ' + res.getBody());
Kindly assist
Recommended Learning For You
Level up your skills with Atlassian learning
Learning Path
Become an effective Jira admin
Manage global settings and shared configurations called schemes to achieve goals more quickly.
Streamline Jira administration with effective governance
Improve how you administer and maintain Jira and minimize clutter for users and administrators.
Learning Path
Become an effective Jira software project admin
Set up software projects and configure tools and agile boards to meet your team's needs.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.