Project

General

Profile

How can I change the parent issue via REST API?

Added by Yoichi Izumi over 13 years ago

Hello.
Redmine v1.0 was released at last, so I tried Rest_api_with_ruby for updating the parent issue.
But I missed.
The code below is wrong?

#!/usr/bin/env ruby

require 'rubygems'
require 'active_resource'

class Issue < ActiveResource::Base
  self.site = 'http://localhost:3000/'
  self.user = 'admin'
  self.password = '...'
end

# Retrieving issue (id=3 has parent_id=2)
issue = Issue.find(3)

# Updating an issue
issue.parent = Issue.find(1)
issue.save
puts issue.parent.id
# at this point, issue.parent.id=1

# confirm...
issue = Issue.find(3)
puts issue.parent.id
# oops, issue.parent.id=2