【问题标题】:Get useful information about a JIRA board using the REST API使用 REST API 获取有关 JIRA 板的有用信息
【发布时间】:2014-07-19 18:40:30
【问题描述】:

我一直在研究 JIRA 最新 REST API (6.0.1) 的文档,以尝试挖掘有关特定仪表板的信息(我正在使用 Dashing 创建一个显示未解决问题数量的小部件在特定的冲刺中)。据此:

https://developer.atlassian.com/static/rest/jira/6.0.1.html

jira.com/rest/api/2/dashboard/11311 只会给我类似的东西:

{
  "id": "11311",
  "name": "blah",
  "self": "jira.com\/rest\/api\/2\/dashboard\/11311",
  "view": "jira.com\/secure\/Dashboard.jspa?selectPageId=11311"
}

这并没有给我很多信息。

在绿虫时代,我们可以通过以下方式获得更多有用的信息:

/rest/greenhopper/1.0/xboard/work/allData.json?rapidViewId=#{board_id}"

(取自here)但这似乎现在不起作用..如果有另一个可能返回更多信息的端点有什么想法吗?

【问题讨论】:

    标签: rest jira dashing


    【解决方案1】:

    我设法通过 jql 查询来做到这一点。 '914' 是敏捷板 ID(找到它的一种巧妙方法是检查板的 'Report' URL 的最后一位)

    SCHEDULER.every '5s', :first_in => 0 do |job|
     uri = URI.parse(jira_url)
     http = Net::HTTP.new(uri.host, uri.port)
     req = Net::HTTP::Get.new("/rest/api/2/search?jql=sprint%20%3D%20914%20AND%20status%20%3D%20%27In%20Progress%27")
     req.basic_auth username, password
     response = http.request(req)
     issuesinProgress = JSON.parse(response.body)["total"]  
     send_event('buzzwords', value: issuesinProgress)
    end
    

    This 是一个非常有用的工具,可以将您的查询编码为 urlencode。

    sprint = 914 AND status = 'In Progress' encodes to sprint%20%3D%20914%20AND%20status%20%3D%20%27In%20Progress%27
    

    【讨论】:

      【解决方案2】:

      jira-python 源代码有一些使用 JIRA Agile REST API 的示例。

      【讨论】:

      • 感谢您的回答。我最终使用了 jql,发布了我的答案。
      猜你喜欢
      • 2019-01-15
      • 2023-02-10
      • 1970-01-01
      • 2017-11-23
      • 2016-10-15
      • 2015-10-11
      • 1970-01-01
      • 2013-01-21
      • 1970-01-01
      相关资源
      最近更新 更多