Slash command to JIRA - how to authenticate user and password

Summary

I try to create a slash command where I would like to get all JIRA tickets assigned to a project.
Curl command is working but Slash command is not.

Steps to reproduce

I tried with this url (but also with -u user:pwd), I don’t get any positive results.

https://mattermost:Password01@10.9.71.87:8443/rest/api/latest/search?jql=project=SDLC+order+by+duedate&fields=id,key

mattermost user is existing in JIRA.

Expected behavior

Get Jira Projects list

Observed behavior

answer code 400, project doesn’t exist but it is existing once logged in. Confirmed with this CURL command
curl --insecure -D- -u mattermost:Password01 -X GET -H “Content-Type: application/json” ‘https://10.9.71.87:8443/rest/api/latest/search?jql=project=SDLC+order+by+duedate&fields=id,key

Hi Denis!

Am I correct in that you’re configuring the slash command request URL directly at JIRA, and expecting the username and password embedded in the URL to authenticate with JIRA?

I’ve tested a slash command locally and can verify that the Basic Auth credentials are correctly parsed from the URL and sent by the Mattermost server. Can you post the logs from your server when running your slash command? I’m wondering if the requirement to invoke curl with --insecure might be part of the problem.

Note that even if you get this part working, you’ll only get a JSON dump back to Mattermost from JIRA, and it won’t match the expected format as described by the documentation. I suspect you’ll want to introduce your own service for proxying JIRA queries like this before long after which the authentication issue should no longer be a problem.