Need help with JIRA integration, Using HTTP request to JIRA works

{“context”:{},“name”:“NodeApiError”,“cause”:{“message”:“401 - "\n\n\n\n\n\n\n\n\n\n\n\n\n\n Unauthorized (401)\n \n\n\n\n\n<script type=\"text/javascript\">\n (function() {\n var contextPath = ‘/jira’;\n\n function printDeprecatedMsg() {\n if (console && console.warn) {\n console.warn(‘DEPRECATED JS - contextPath global variable has been deprecated since 7.4.0. Use wrm/context-path module instead.’);\n }\n }\n\n Object.defineProperty(window, ‘contextPath’, {\n get: function() {\n printDeprecatedMsg();\n return contextPath;\n },\n set: function(value) {\n printDeprecatedMsg();\n contextPath = value;\n }\n });\n })();\n\n\n\n<link type=\"text/css\" rel=\"stylesheet\" href=\"/jira/s/bf26a0c094c32a139024b7be643fd3e4-CDN/-fmjzbr/813025/zij3ij/4f102726bf73efcb362ccf6b0528edb7//download/contextbatch/css/_super/batch.css\" data-wrm-key=\"super\" data-wrm-batch-type=\"context\" media=\"all\">\n<link type=\"text/css\" rel=\"stylesheet\" href=\"/jira/s/72b52e114cef946b092d519566406e7e-CDN/-fmjzbr/813025/zij3ij/343d8855cec0563ab9c9c53b0e61f06b//download/contextbatch/css/atl.general,jira.general,jira.global,-_super/batch.css?agile_global_admin_condition=true&jag=true\" data-wrm-key=\"atl.general,jira.general,jira.global,-super\" data-wrm-batch-type=\"context\" media=\"all\">\n<script type=\"text/javascript\" src=\"/jira/s/3b909863b4599df663793674b788f11e-CDN/-fmjzbr/813025/zij3ij/4f102726bf73efcb362ccf6b0528edb7//download/contextbatch/js/_super/batch.js?locale=en-US\" data-wrm-key=\"super\" data-wrm-batch-type=\"context\" data-initially-rendered>\n<script type=\"text/javascript\" src=\"/jira/s/683c99dab172249acc6da241d14cfba8-CDN/-fmjzbr/813025/zij3ij/343d8855cec0563ab9c9c53b0e61f06b//download/contextbatch/js/atl.general,jira.general,jira.global,-_super/batch.js?agile_global_admin_condition=true&jag=true&locale=en-US\" data-wrm-key=\"atl.general,jira.general,jira.global,-super\" data-wrm-batch-type=\"context\" data-initially-rendered>\n<script type=\"text/javascript\" src=\"/jira/s/e62868a335e05bb42b00ba9603199870-CDN/-fmjzbr/813025/zij3ij/aae1242f5fc81cc6a5bb8bc963ccda29//download/contextbatch/js/atl.global,-_super/batch.js?locale=en-US\" data-wrm-key=\"atl.global,-super\" data-wrm-batch-type=\"context\" data-initially-rendered>\n<link type=\"text/css\" rel=\"stylesheet\" href=\"/jira/s/350863f84213f7271e00a3f7a70fe7ff-CDN/-fmjzbr/813025/zij3ij/d0590ce972b8bb0917f055eaab2326ca//download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css\" data-wrm-key=\"jira.global.look-and-feel,-_super\" data-wrm-batch-type=\"context\" media=\"all\">\n\n<script type=\"text/javascript\" src=\"/jira/rest/api/1.0/shortcuts/813025/6f8b3adf506f7f37475e6c96576f7e3b/shortcuts.js\">\n\n\n <meta name=\"application-name\" content=\"JIRA\" data-name=\"jira\" data-version=\"8.13.25\">\n\n<body id=\"jira\" class=\"aui-layout aui-style-default page-type-message \" data-version=\"8.13.25\" >\n <div class=\"aui-page-panel\" ><div class=\"aui-page-panel-inner\">\n <main role=\"main\" id=\"main\" class=\"aui-page-panel-content\" >\n <div class=\"aui-page-header\" ><div class=\"aui-page-header-inner\">\n <div class=\"aui-page-header-main\" >\n

Unauthorized (401)

\n \n \n <div class=\"aui-message aui-message-warning warning\">\n

Encountered a "401 - Unauthorized" error while loading this page.

\n

Basic Authentication Failure - Reason : AUTHENTICATED_FAILED

\n

<a href=\"/jira/secure/MyJiraHome.jspa\">Go to Jira home

\n \n \n \n\n\n"”,“name”:“Error”,“stack”:“Error: Request failed with status code 401\n at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n at IncomingMessage.emit (node:events:525:35)\n at endReadableNT (node:internal/streams/readable:1358:12)\n at processTicksAndRejections (node:internal/process/task_queues:83:21)”},“timestamp”:1663801186640,“message”:“Authorization failed - please check your credentials”,“node”:{“parameters”:{“jiraVersion”:“cloud”,“resource”:“issue”,“operation”:“get”,“issueKey”:“MIGSOFTWAR-4080”,“simplifyOutput”:false,“additionalFields”:{}},“name”:“Jira”,“type”:“n8n-nodes-base.jira”,“position”:[440,300],“typeVersion”:1,“id”:“89c59abd-91d6-45aa-b752-901f6bc67523”,“credentials”:{“jiraSoftwareCloudApi”:{“id”:“6”,“name”:“Jira SW Cloud account”}}},“httpCode”:“401”,“description”:null}

Hey @Ramesh_Raghupathy, welcome to the community!

A 401 error suggests a problem with your credentials. So, in a first step you might want to double-check these.

If you’re using the same credentials in your HTTP Request node successfully, chances are the operation you are trying to run in the Jira node isn’t allowed for your user (though this is just a guess - I am not too familiar with the exact conditions under which Jira would return a 401 error).

Thanks for the prompt response! I found the problem and it is due to the misleading label. The credential page gives option for “email”, “password”, “domain”. However, I noticed that the “email” label does not represent my email, it is may username. When I used my username, instead of the email it started working. Thanks again!

2 Likes

Perfect, thank you so much for confirming and sorry for the confusion. @Jon, should we perhaps consider updating the label? Tbh, I am not sure if this might differ between Jira versions.

@MutedJam I thought Atlassian changed the login to try and enforce emails, I see no harm changing the label to “user identity” or something generic. I will chat to the product team and see what they think.