Empty and Error Responses from Jira Cloud Basic Auth with API Token

Eric Stephenson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 18, 2019

I am working on changing our apps to use basic auth with an API Token per Jira's deprecation notice, but GET create meta returns an empty array:

curl -D- \
   -u fred@example.com:freds_api_token \
   -X GET \
   -H "Content-Type: application/json" \
   https://your-domain.atlassian.net/rest/api/3/issue/createmeta

# =>  {"expand":"projects","projects":[]}

and a POST request to create an issue returns an error response similar to when the user does not have admin permission to edit the screen:

"Field <field name> cannot be set. It is not on the appropriate screen, or unknown."

However, the supplied user name definitely has admin permission.

I have also tried this with the Base64 encoded user:token in the Authorization header

but I get the same responses.

Any help would be much appreciated.

 

 

1 answer

0 votes
Eric Stephenson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 18, 2019

For anyone who lands here, there is an important caveat to Jira API Tokens:  they will have the same permission level as the user who creates them.

https://community.atlassian.com/t5/Jira-questions/API-Token-Not-Matching-User-Permission/qaq-p/826132

I just ran successful curls to our Endpoint using an API Token created by an admin user, AND the user's full email address.

Issue resolved.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events