Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3630

How to add user to custom field "User Picker" in C#?

$
0
0

I'm trying to set a user in a custom field of type "user picker" using the Atlassian SDK for C#.

When I try to add the user just like any other field it is set in code but not on Jira. And in another request (for a transition) Jira responds with FieldReviewerisrequired.

Here is what I've tried so far...

JiraUser? user = await issue.Jira.Users.GetMyselfAsync(cancellationToken);issue[field.Name] = user.AccountId;

and

var putFields = new{    fields = new    {        customfield_10824 = new[]        {            new            {                accountId = user.AccountId            }        }    }};await issue.Jira.RestClient.ExecuteRequestAsync(RestSharp.Method.PUT, $"/rest/api/2/issue/{issue.Key}", putFields, cancellationToken);

and with the CustomFields

issue.CustomFields.AddById(field.Id, user.AccountId);//issue.CustomFields.Add(field.Name, user.AccountId);

Viewing all articles
Browse latest Browse all 3630

Trending Articles