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.
mattermost user is existing in JIRA.
Get Jira Projects list
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’
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.