Slack bot Jira authentication

Dear Friends,
I suppose someone can help me with a solution for the problem and assume someone has already encountered this problem before.

I have created a slack bot that accepts questions on the channel and if the search results from knowledge base returns nothing, I then create a Jira issue with the chat message as the summary. I am using the restkit Resource to create the Jira and BasicAuth for authentication filter(as described in the REST API doc). A Jira is created always with my name as ‘Reporter’. This is obvious because I have hard coded my name and password in the bot script for the basic auth. What I want is to create the Jira with the ‘Reporter’ being the person who has put the message in the slack channel(assuming the user has the required access to Jira). Any ideas on this? I am able to get the name of the user who has posted the message in slack.

Also, is there a possibility that the Jira issue can be created bypassing the basic auth? (I mean in my Jira project I allow everyone to create Jira issues and do not require any auth)

Thanks for all the comments and answers.

Best Regards,

hi @madhav.kulkarni1986,

First off: are you building for Jira Cloud or Jira Server? As the answer you need might differ depending on what you are using.

Second: a Jira ticket always needs a reporter, and to know the reporter somebody has to authenticate (either the user or yourself).

Third: you could take a look at using Oauth for your app instead of Basic Auth. This should help you with your question on how to get the person asking the question as the reporter.

Here are our Oauth docs:

1 Like

Hi @pvandevoorde,

Thanks for your answer and the links. I am working with Jira cloud.

I see a disconnection here. Slack does not provide the full authentication details to the bot I created. Hence, by just using the user name I cannot create the Jira issue. I need to figure out what can be done from slack side. I will try the SSO option and the OAuth as you suggested.

Best Regards,

1 Like