7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/jira_client/api/worklogs.rb', line 7
def create_worklog(key, time, opts={})
url = "/issue/#{key}/worklog"
url += "?adjustEstimate=new&newEstimate=#{opts[:remaining_estimate]}" if opts.has_key? :remaining_estimate
url += "?adjustEstimate=manual&reduceBy=#{opts[:reduce_estimate]}" if opts.has_key? :reduce_estimate
time_in_seconds = ChronicDuration.parse(time)
params = {
:timeSpentSeconds => time_in_seconds
}
params[:comment] = opts[:comment] if opts.has_key? :comment
post(url, params)
end
|