Trying to write a script for Jira Cloud

Currently I am writing a script to grab epics and initiatives.

I am using Javascript and Node. I am running into a few issues.

I can access the api but it seems when I search for issues I receive an error (see below):

{“errorMessages”:[“Issue does not exist or you do not have permission to see it.”],“errors”:{}}’ }

I have admin access for all of my Jira org. So I should not be receiving this error. But I also read somewhere that if you use basic auth, you will view as a anonymous user, which may or may not be true:

x-ausername’: ‘anonymous’,

I did pull this from my response. So it leads me to believe it is true.

I am also using basic authorization username and password. I was wondering do I need to actually use OAuth instead.

And if so, is there any simple documentation to get authorization tokens. Or can someone provide me with more insight regarding this.

Hi, @cpriestley.

Using command line, I tried a GET on my instance, https://testian.atlassian.net/rest/api/2/search?jql="project in (myProject)" and so far it yields positive results with X-AUSERNAME custom response header having the username I passed in the Basic Auth. Do you mind sharing a snippet on how you invoked it? Please remove the Basic Auth part.

Cheers!