Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GitHub Ruby API-更新请求描述_Ruby_Github_Jira_Github Api - Fatal编程技术网

GitHub Ruby API-更新请求描述

GitHub Ruby API-更新请求描述,ruby,github,jira,github-api,Ruby,Github,Jira,Github Api,我正在使用以下github ruby api: 我正在尝试更新一个pull请求的描述,但是文档似乎没有给出任何关于如何实现这一点的想法。 以下是我目前的代码: def link_github_jira github = Github.new basic_auth: 'user:pass' @github_jira = github.pull_requests.list '<Name>', '<reposity_name>', state: 'open'

我正在使用以下github ruby api: 我正在尝试更新一个pull请求的描述,但是文档似乎没有给出任何关于如何实现这一点的想法。 以下是我目前的代码:

def link_github_jira
    github = Github.new basic_auth: 'user:pass'
    @github_jira = github.pull_requests.list '<Name>', '<reposity_name>', state: 'open'
    @github_data = []
    @issues      = []

    @github_jira.each do | x |
      @github_data << x
    end

    @github_data.each do | x | 
      pull_id = x["title"].to_i 
      @pull_request_description = x["body"]
      if pull_id.is_a?(Integer) 
        uri = URI.parse("http://<jira_url>/rest/api/2/issue/#{pull_id}")
        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.basic_auth '<jira_user>', '<jira_pass>'
        request["Content-Type"] = "application/json"
        @jira_response = http.request(request)
        @issues << JSON.parse(@jira_response.body)
        if !@pull_request_description.include?("<jira_url>") 
            #add Jira link to pull description as it does not already exist 
        end
      end 
    end
  end
def link\u github\u jira
github=github.new basic_auth:'user:pass'
@github\u jira=github.pull\u requests.list“”,“”,状态为:“打开”
@github_数据=[]
@问题=[]
@github_jira.每个都有| x|

@github_数据通过使用此github Ruby API解决:

可以使用以下代码更新拉取请求:

client.update_pull_request("<repository>", <pull_id>, <pull_title>, <pull_description>, <pull_state>) 
client.update\u pull\u请求(“,”)

改用此GitHub Ruby API解决:

可以使用以下代码更新拉取请求:

client.update_pull_request("<repository>", <pull_id>, <pull_title>, <pull_description>, <pull_state>) 
client.update\u pull\u请求(“,”)