TestRail - Connect through API fails when two-step verification is enabled for user

Ory Zaidenvorm May 14, 2018

We're using JIRA Software together with TestRail. To be able to push defects from failed tests into JIRA, the integration requires a user ID and password. However when I try and push a defect from TestRail I get the following message:

Plugin "Jira_REST" returned an error: Invalid user or password or insufficient permissions for the integration user (HTTP code 401). Please make sure to use your actual JIRA username for the integration (not your email address, for example).

 

This error doesn't occur when entering the details of a user which doesn't have two-step verification enabled, making me suspect that the API call is returning 401 because of the two step verification.

 

Even when generating an API token (https://confluence.atlassian.com/cloud/api-tokens-938839638.html) I'm getting the same error.

 

How can I fix this?

1 answer

1 accepted

1 vote
Answer accepted
Ory Zaidenvorm May 28, 2018

Figured it out - using API tokens work, but you must then use your full email address (and not just your JIRA username).

Natalia Oks October 5, 2018

I had the same issue, using API token and full email address fixed it for me. Thank you!

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 29, 2019

Hi,

I'm having the same issue. Could you please let me the details on how you fix it? 

Where exactly would I input the full email address?

Appreciate if you could provide the steps.

 

Regards,

Ory Zaidenvorm April 29, 2019

Hi @Zaldy Parian ,

TestRail has recently been updated to only work with API Tokens. This has introduced new fields (JIRA Email and JIRA API Token) to replace the old ones (JIRA User and JIRA Password).

See this page for explanation on how to update your instance:

https://blog.gurock.com/jira-cloud-update/ 

I've just followed the steps and it all works again now.

Let me know if you still encounter any issues.

Like Jude Perez likes this
Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2019

Yep, I did the steps the first time I received the notification about API token-based authentication. However, I'm still having an issue. This time the error was for

"Invalid user or password or insufficient permissions for the integration user (HHTP code 401). Please check the Jura User value in the Integration and/or User Settings has been configured correctly."

Ory Zaidenvorm April 30, 2019

Is that with the credentials that are set up as the fallback user (under Admin > Integration > JIRA) or for your user (Profile > Settings)?

Also on the Atlassian Profile API Tokens page, does it show an attempt to use the API Token (you can see it in the last used column)?

I'd check them separately to isolate the issue you're having.

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2019

First of all, thanks for your replying and following this up. I really appreciate it.

I have set up both Integration and User settings as per the documentation for API token-based authentication. But the token is never use as per the attachment.

Btw, my email is also the backup email as I'm the administration for both TestRail and Jira. Would that be an issue?

api_token_settings.jpg

Ory Zaidenvorm May 1, 2019

No, having the same JIRA email as the fallback should not be an issue. 

It looks like you're doing all the right things. The only other thing I can suggest is to double check the email is correct and exactly the same as the one on your JIRA profile and that the other plugin configuration details are correct. If all of that fails maybe try with different credentials (a colleague etc.)

Sorry I couldn't be of more help!

Zaldy Parian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 1, 2019

I was able to fix this by....

1. check if the user have another account.

2. delete the extra account

3. ask the user to logout

4. revoke the api token

5. regenerate the token

6. ask the user to re-login and check the integration between TestRail and Jira

 

Hope this help others in the future.

Ory Zaidenvorm May 1, 2019

Glad you sorted it out!

Suggest an answer

Log in or Sign up to answer