I've been going through this guide: JIRA API Documentation and can't seem to figure out how to simply authenticate to the API if you're using gmail to login to Jira. I'm hoping to use the REST API within my ruby app in order to link github and jira
Edit: Code:
uri = URI.parse("https://<address>.jira.com/rest/api/2/issue/<issue-name>")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
request["user"] = "<username>"
request["password"] = "<password>"
@jira_response = http.request(request)
With the above code; I get a HTTP unauthorized response.
Resolved by using;
request.basic_auth 'username', 'password'
request["Content-Type"] = "application/json"
instead of:
request["user"] = "<username>"
request["password"] = "<password>"
A while ago I wrote a small skeleton app for using the Jira api. It may or may not be helpful for you. See https://github.com/vaneyckt/SimpleJira .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.