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?
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>
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.