[英]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.