Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignee update in Issue #349

Closed
DamianCieslak opened this issue Mar 27, 2024 · 1 comment
Closed

Assignee update in Issue #349

DamianCieslak opened this issue Mar 27, 2024 · 1 comment

Comments

@DamianCieslak
Copy link

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.Id' cannot be used in this context because the set accessor is inaccessible

Do you have any suggestions on how to solve this?

@zapadi
Copy link
Owner

zapadi commented Mar 27, 2024

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 zapadi closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants