Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to set value for a user picker custom field?

Aditi Choksi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 1, 2021

I want to write a python script that automatically creates a jira issue and populates a custom field in it. The custom field is of type user picker. What should I send as 'fields' from my code so that this field gets populated.

 

I have tried a bunch things:

{<custom_field_id>:  {name: "name of user"}}

{<custom_field_id>:  {value: "name of user"}}

{<custom_field_id>:  {name: "email"}}

{<custom_field_id>:  {value: "email"}}

 

but nothing seems to work, the user field is always 'None'. Is there some specific configuration for the custom field that would make this work. What am I doing wrong?

1 answer

1 accepted

1 vote
Answer accepted
Michael Andolfatto
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.
September 1, 2021

Hi @Aditi Choksi , welcome to the Community!

You will want to use the accountId attribute when handling users in Cloud, Atlassian adopted these changes to align with GDPR regulations you can review here.

If you are a Site Admin, you can easily retrieve this value in the application by navigating to the user in User Management. Their Account ID will be in the URL as follows:

 

https://admin.atlassian.com/s/<YOUR_CLOUD_SITE_ID>/users/<USER_ACCOUNT_ID>

Aditi Choksi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 3, 2021

Hi @Michael Andolfatto 

 

Thanks for the response. I don't have the account id available. All I have is the email id. I ended up making the following http call to obtain the user.

https://your-domain.atlassian.net/rest/api/3/user/picker?query={email}

 

Once we get the user, set {<custom_field_id>: <userObject>}.

I am using jira client 3.0.1. Is there an api in the client that can be used to fetch a user from email. I want to avoid making a direct HTTP call from my code.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events