redmine-net-api icon indicating copy to clipboard operation
redmine-net-api copied to clipboard

Assignee update in Issue

Open DamianCieslak opened this issue 1 year ago • 1 comments

Hi,

I have the latest version of redmine-api 4.6.5. The problem I encountered is Assignee update in Issue. According to the api documentation, I should perform something like this:

var manager = new RedmineManager(host, apiKey);
var issue = manager.GetObject<Issue>("2351", new NameValueCollection());
var user = manager.GetObject<User>("20", new NameValueCollection());
issue.AssignedTo = new IdentifiableName { Id = user.Id, Name = user.FirstName + " " + user.LastName }; //Id problem
manager.UpdateObject<Issue>("2351", issue);

But I get an error: The property or indexer 'Identifiable<IdentifiableName>.Id' cannot be used in this context because the set accessor is inaccessible

Do you have any suggestions on how to solve this?

DamianCieslak avatar Mar 27 '24 13:03 DamianCieslak

Hi,

Currently, there is no mechanism to assign by name. Only the ID is accepted and you can do it like 👇

issue.AssignedTo = IdentifiableName.Create<IdentifiableName>(Id = user.Id);

zapadi avatar Mar 27 '24 21:03 zapadi