Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,423
Community Members
 
Community Events
184
Community Groups

How do I set a custom "User" field using the API

Edited

I have been trying to set the value of a custom field that contains a single user name via the API and I keep receiving the following error:

"errorMessages": [
"Can not instantiate value of type [simple type, class com.atlassian.jira.rest.api.issue.FieldOperation] from JSON String; no single-String constructor/factory method (through reference chain: com.atlassian.jira.rest.v2.issue.IssueUpdateBean[\"update\"])"

The command I am using is as follows except username has the name of an actual user:

{"update":{"fields":["customfield_10108": {name:"username"}]}}

I have also tried {"update":{"fields":["customfield_10108": {"name":"username"}]}} 

Any help is greatly appreciated.

BTW: Using JIRA Server 8.5.3

 

 

1 answer

1 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Apr 01, 2021

Hi @Denise Wermager 

In your first JSON example, it seems you have some extra curly brackets; are using update and fields; and are missing quotation marks around the field "name".  Perhaps try this, as with a single value you only need fields:

{
"fields": {
"customfield_10108": { "name": "username" }
}
}

Here is a documentation references that may help also:

https://confluence.atlassian.com/automation/advanced-field-editing-993924663.html

Best regards,

Bill

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events