0
Redmineでチケットを作成するためにcURLをリクエストすると、このエラーが発生します。私のcURLはチケットを正常に作成していますが、エラーも返されています。なぜそうなのか理解できません。NoMethodError(未定義メソッド `id 'for nil:NilClass)
ここで私が取得していますエラーです:
Started POST "/issues.json" for 122.161.50.0 at 2016-04-16 07:18:22 +0000
Processing by IssuesController#create as JSON
Parameters: {"issue"=>{"project_id"=>10, "tracker_id"=>7, "status_id"=>1, "priority_id"=>3, "subject"=>"Issue created from CURL"}}
Current user: himanshu (id=3)
Rendered mailer/_issue.text.erb (6.8ms)
Rendered mailer/issue_add.text.erb within layouts/mailer (45.6ms)
Rendered mailer/_issue.html.erb (2.3ms)
Rendered mailer/issue_add.html.erb within layouts/mailer (6.9ms)
Completed 500 Internal Server Error in 724.8ms
NoMethodError (undefined method `id' for nil:NilClass):
lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
lib/redmine/hook.rb:61:in `each'
lib/redmine/hook.rb:61:in `block in call_hook'
lib/redmine/hook.rb:58:in `tap'
lib/redmine/hook.rb:58:in `call_hook'
lib/redmine/hook.rb:153:in `call_hook'
app/controllers/issues_controller.rb:151:in `create'
これは、これはフック
def call_hook(hook, context={})
[].tap do |response|
hls = hook_listeners(hook)
if hls.any?
hls.each {|listener| response << listener.send(hook, context)}
end
end
end
を確認してください。 – Noma4i