[英]create issue in Jira API using Ruby rest client
我正在尝试使用ruby中的rest-client在Jira中创建问题,我是该方法的新手(到目前为止仅使用邮递员),而且我不理解“ URL,有效载荷,标题”结构-在“字段”是我的“有效载荷”或我要发送的字段,我无法使用rest-client成功发送成功的发帖请求,并且感谢所有给予的帮助:)
url = 'my_url'
response = RestClient::Request.new(
:method => :post,
:url => url,
:user => 'username',
:password => 'pasword',
:fields => {
:project => {:id => 'some_id'},
:issuetype => {:id => 'some_type_id'},
:reporter => {:name => 'some_name'},
:components => [{:id => 'some_comp_id'}]
},
:headers => { :content_type => :json },
).execute
results = JSON.parse(response.to_str, symbolize_names: true)
PS-我没有分享错误响应,原因是每次我更改某项内容似乎都会得到一种不同的结果时,我的问题在于我认为的语法以及对该请求正确结构的误解。
当前错误是-415不支持的媒体类型
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.