Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Plugin Jira_Rest Returned Error HTTP Code 401


#1

Hi, I’m having the same problem as found in multiple similar posts but mainly similar to this one…

I’m using Jira cloud 7. When I click PUSH on a Test Case, I get the message about possible permission error or email instead of username. My username is correct and I’m in most/all administrator groups in Test Rails and Jira.
I played around with some of the suggestions on this post and others but nothing made a difference. Same error.

Config screen uploaded below.

Thanks,
AB.


#2

Hi Alec,

Thanks for your posting! The warning icon next to the Defect Plugin dropdown (and the large yellow box you should see above the tab control) indicates that you’ve overridden the integration settings for one or more of your projects. The project settings override the global integration settings on Administration > Integration and I would recommend clearing the settings on the project level and then try again (Administration > Projects > edit a project > Defects/References tabs).

Cheers,
Tobias


#4

Tobias,
I cleared out the Project settings as you recommended Confirmed that all projects are set to use Global Integration settings. However, when I return to the Test run step in question and click on Fail then PUSH (Defect), I still get the same error as before,

“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).”

Did I miss something? Any other ideas as to what I could try?

Thanks Much,
alec


#5

Hi Alec,

Thanks for your reply. Can you check if you entered the correct username and password for the integration user (either on My Settings or the fallback credentials on Administration > Integration)? Authentication can also fail if your username or password use non-standard characters (such as Unicode) and I believe this is a limitation of JIRA’s API.

Cheers,
Tobias


#6

Tobias,
Thanks for the tip.
I changed the password in both Jira and TR to contain ONLY alpha-numeric chars yet to no avail. I still get the exact same 401 error message. Any ideas on what I could try next?
Thanks!
Alec


#7

Hi Alec,

Please make sure you’ve changed the credentials in the correct location in TestRail. If you have set/overridden the credentials on My Settings, you would also need to update the credentials there. If you use the credentials only on Administration > Integration, you would need to update this page instead.

Cheers,
Tobias


#8

Tobias,
I updated the creds in both locations.
Alec


#9

Hi Alec,

If you are sure that the credentials match, the next step is to enable debug logging to review the communication between JIRA and TestRail. If you are on TestRail Cloud, please send a quick email to contact@gurock.com so we can enable debug logging for you and review the logs. If you use TestRail Server, you can enable debug logging yourself as follows:

http://docs.gurock.com/testrail-faq/system-debug

Cheers,
Tobias


#10

For anyone who may come across this, I’ve found the answer to the problem and am sharing in hopes that it will save someone a lot of time and hair loss.

In my case, the username I placed into TestRail integration windows was not working. The reason for this is because I was the first user in Jira --> admin.

If I go into the list of users in Jira I see my username as “abrindell” and I use “abrindell” to login with successfully. This is actually NOT what I need to use for integration from TestRail. If you are the admin user of Jira, go into your profile settings and you’ll see that Jira has a different username for you --> admin.

Once I placed the value admin into the username field of the TestRail integration settings PUSH defect worked like a charm.

I hope this helps someone.
A Brindell


Unable to install TestRail on JIRA Cloud. 401 received
#11

Hi Alec,

Great to hear it works now! This is unfortunate behavior and we haven’t seen this before and this is just another thing to keep in mind when seeing 401 responses with JIRA I guess :slight_smile: Thanks for letting us know, this will definitely save time in the future :slight_smile:

Cheers,
Tobias


#12

Thank you for the workaround!!!