LoginSignup
1
1

More than 3 years have passed since last update.

jiraのapi

basic認証とoauth認証があるみたいだが、oauth認証はaccess tokenを取得して、再取得するのが面倒そうなので、basic認証を使うことに。

が、Deprecatedになったみたい?
https://community.atlassian.com/t5/Confluence-questions/Trying-to-access-Confluence-using-Basic-Authentication/qaq-p/1268998

api_tokenを使ってapi呼び出し

こっち見るとapi_tokenというのを使えばいいみたい
https://community.atlassian.com/t5/Confluence-questions/Trying-to-access-Confluence-using-Basic-Authentication/qaq-p/1268998

ということでrubyだと以下で取れる。
jira-rubyというgemがあるが今の所対応してないので、自分で取るしかないみたい


user_name = "hogehoge@hoge.com"
api_token = 'mogemogemoge'
jira_api_endpoint = "https://hogemogehoge.atlassian.net"

result_json = JSON.parse(`curl -u #{user_name}:#{api_token} #{jira_api_endpoint}`)
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1