Error after setup of API token-based authentication

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

Hi,

I have followed the instructions on how to setup the API token-based authentication. Updates were made in the Integration and My Settings.

However, I keep on getting the error....

Plugin "Jira_Cloud_REST" returned an error: Invalid user or password or insufficient permissions for the integration user (HTTP code 401). Please check the Jira User value in the Integration and/or User Settings has been configured correctly.

Could someone please help? All our TestRail users using the 'Push' link are completely annoyed as the integration to Jira is not working and have to create the defect manually.

I need a solution urgently for this newly introduced authentication that does not work on us at the moment.

6 answers

1 accepted

0 votes
Answer accepted
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.

- June 15, 2021

How do I check if I have another account created

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.
June 15, 2021

See if the user registered on a different name. It could be a user registered with his/her second or middle name. Or it could be the user used his/her initials when he registered.

Like AK likes this
AK June 21, 2021

 

you need to do one last thing to make it work. If you have multiple teammates working on Testrail, you should have each of them configure their own credentials by going to their user's settings under your name in the top right corner of my settings, in the settings tab. If you do not enter their own authentication credentials the integration will still work for them but the issue is if they push from Testaril to Jira this will be attributed to the user account associated with the fallback credentials. Once it's done the configuration is complete and you can start to use it without any issues.

Thanks 

Testrail.png

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.
June 21, 2021

Hi AK,

In our case it is the account in TestRail. We use the TestRail to manage our test execution. In TestRail admin page, go to Users & Roles. Then search for that user who's having API issue. What I did was to delete the other user account -- e.g., couple of our users registered with 2 account.

After that, I asked them to revoke the previously setup API token in Jira. And then generate a new token to be copied in TestRail.

 

Hope this helps. 

Like AK likes this
Hendri March 30, 2022

Hi, Zaldy 

are you have solve about your problem of integration testrail with jira ? because I got the same problem like you.

 

can you help me ?

 

Thank you

Like Pradeep Srinivasan likes this
1 vote
Pooja Ganachari March 12, 2023

Thank you so much folks your all comments made me to resolve the Plugin "Jira_Cloud_REST".

Me (In the Lead role of TestRail) and My Manager (Admin role of TestRail) both together solved this with the below steps. (Sharing with some more specific steps)

1.Go to the Jira link- https://<<id.atlassian.com>>/manage-profile/security/api-tokensAtlassian account

2.Revoke all the API from the page and create new API Token. (Make sure that have the copy of the token written down somewhere.

3.Go to the testrail account-->Logout the account if you are opened it already.

4.Close the entire browser or open the testrail in the incognito mode and login again.

5.Go to the administrator link -->Integration-->Configure the jira-->Fill up again all the required details, Jira address, Email id, Jira account type and new API token (Generated Newly) and SAVE THE SETTINGS for Jira integration.

6.Make sure that you should be getting the success message for this integration.

7.Go to the My setting (Under your name)-->Settings-->Enter Jira email address and token created newly and save.

8.Make sure that you should be getting the success message for this settings

9.Go to the testcases and check the link and confirm. (My manager getting the details this time)

10.I (as a testrail user lead role) went to My settings-->(Under your name)-->Settings-->Enter Jira email address and token created newly and saved.

11.Went to the testcases and checked the link-Thats started working for me too.

12.I created the bug from the Push defect and add defect both and both the links where showing the reporter name as mine to me as well as to my manager. So that's what we wanted to solve our problem.

1 vote
Nghia Kim Nguyen November 21, 2022

I had the same error showing up in the popup (HTTP code 401) when I mouse hovered the Jira link under Defect field.
Here it was not caused by an extra account as per @Zaldy Parian's initial post, but seemed like caused by an API token that simply was not working.

So based on what everything written above:
1. Revoked all my API tokens in Jira and created a new one. How? pls read previous comments...
2. Then in TestRail, updated the API token under [Your name] -> My Settings -> Settings
3. Save
4. Logout and close fully the browser (all tabs)
5. Relaunched TestRail and went back to the test run with the link and mouse hovered it
Now the error is gone and I see the Jira content in the popup

1 vote
Arita September 6, 2022

I got a solution on this link
https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/ 
shared by @Pradeep Srinivasan 

  1. Revoke all the current tokens on Jira 
  2. Create new token on Jira 
  3. On Testrail navigate to Administration>>>Integration>>>User variable.
  4. Click on edit on Jira email row.
  5. Append the email with the email that created the new token.
  6. Edit the Jira token row and replace it with the new token on step two.
  7. Click on save button.

At least this worked from my side.

Nghia Kim Nguyen November 21, 2022

Hello, I might be wrong but I think step #3 is under [Your name] -> My Settings -> Settings, because one cannot change the existing token under Integration -> User Variable in step #6, unless you meant to update the Fallback field?
That's where I updated the token to fix my issue.

Like Pradeep Srinivasan likes this
Infomed Niki July 11, 2023

@Arita, great million thanks! It really worked with me as well!

Like # people like this
1 vote
Katy Wynne January 6, 2022

From JIRA > Account Settings > API Tokens:  Screenshot of it being accessed:

 

Capture.PNG

1 vote
AK June 21, 2021

you need to do one last thing to make it work. If you have multiple teammates working on Testrail, you should have each of them configure their own credentials by going to their user's settings under your name in the top right corner of my settings, in the settings tab. If you do not enter their own authentication credentials the integration will still work for them but the issue is if they push from Testaril to Jira this will be attributed to the user account associated with the fallback credentials. Once it's done the configuration is complete and you can start to use it without any issues.

Thanks Testrail.png

Pradeep Srinivasan September 6, 2021

This solution works. Thank you! 

To generate the API token, follow the steps mentioned here https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/

Katy Wynne January 6, 2022

I've attempted both of the steps above, the API is showing as being accessed within JIRA but I get either a 403 error or 404 from Test Rail depending on the project. I have full permissions on the projects, however I am using JIRA Service Management. I setup a trial version on JIRA and Testrail to follow from the beginning and having the same issue. 

 

Is Test Rail integration not compatible with JIRA Service Management:

 

Testrail Version - 7.2.5.1000

Would appreciate some guidance into the above, it's frustrating to not be able to connect these two.

Like Pradeep Srinivasan likes this
AK January 6, 2022

Hi Katy Wynne

How you create the token? 

Like # people like this
Katy Wynne January 6, 2022

From JIRA > Account Settings > API Tokens:  Screenshot of it being accessed:

 

Capture.PNG

Like # people like this
Clara Ramos May 6, 2022

Have you being able to fix it? I'm having the same 404 error. 

Like Pradeep Srinivasan likes this
Nghia Kim Nguyen November 21, 2022

This is very helpful!

Like Pradeep Srinivasan likes this

Suggest an answer

Log in or Sign up to answer