Is there a smart value for auto-assigning users, other than the Atlassian ID?
Asked by Erin Quick-Laughlin:

I've setup a JA rule that pulls data from an API call, and responds with things like email, name and the unique Atlassian Id.

The component of "Assign the issue to" is set to 'Smart value' and will only take the Atlassian ID. I was hoping it would take email address, like importing from a CSV can, but I'm not having any luck there.

Is there a way to format the Full Name or Email Address value so that it will accept it?

side note: Ultimately, we're trying to auto-assign tasks by a combo of two values (Product \& Department), on Create. If anyone has a better solution besides building an API for this kind of lookup, I would be grateful to hear your solution. It would be better if we had the simplest interface possible for line-of-business people to keep the lookup data updated, and would much prefer to keep this all within Jira/Confluence. Having to lookup the Atlassian ID to store it is not the preference.


Answers:
author: Mark Chaimungkalanont
body: Hey there,

If you use the email address as a smart value in the Assignee field in the Edit issue action, Automation will try to resolve that email to a user (it might not work if they've restricted access to their email)

Hope that helps!

Cheers,

Mark C

comments: author: Erin Quick-Laughlin
body: Thanks [@Mark Chaimungkalanont](/t5/user/viewprofilepage/user-id/475825) !

So instead of using Assign issue, I could use Edit issue Assignee field.

Regarding restrictions, is the Automation for Jira user considered to have access if an account Contact (email) is set for "Only visible to people who have access to the organization"?

Best regards,

Erin


author: Erin Quick-Laughlin
body: Hi [@Mark Chaimungkalanont](/t5/user/viewprofilepage/user-id/475825) - maybe I'm doing something wrong, but it still won's assign me by email address, for instance, here's the rule \& log instance - and yet this doesn't show up as Jira Automation in the log of the issue, and it doesn't assign me.... support ticket worthy?  
![rule.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/163148iB7AC7E669C052EFD/image-size/large?v=v2&px=999 "rule.PNG")![component-json.png](https://community.atlassian.com/t5/image/serverpage/image-id/163150iDB15121076963A46/image-size/large?v=v2&px=999 "component-json.png")  

<br />


author: Alex Koxaras _Relational_
body: Hi [@Erin Quick-Laughlin](/t5/user/viewprofilepage/user-id/4299733)

Can you share your JA rule please? I mean "assign to a user" has a plethora of option, and I didn't quite understand why you've chosen the "smart value" option.

Cheers!

comments: author: Erin Quick-Laughlin
body: Thank you for responding [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197) !

![Screenshot 2021-09-13 082349.png](https://community.atlassian.com/t5/image/serverpage/image-id/160028i34F1295ACA78BF7C/image-size/large?v=v2&px=999 "Screenshot 2021-09-13 082349.png")   
(it's currently listening to priority changes instead of new issue creation, for testing purposes)

Here's what is in the log for the various web responses (with some scrubbing of values):

email = **erin.quick-laughlin@pxxxxxxxxxl.com** and name = **Erin Quick-Laughlin** and atlassianid = **5xxxxxxxxxxxxxxxxxxxd197**

Using webResponse.body.**atlassianid** works.

When I change the rule to use webResponse.body.**email** or webResponse.body.**name** , it doesn't recognize those values to associate / assign a user. I was hoping it could recognize a user by email, like the import process can.


author: Alex Koxaras _Relational_
body: From what I know, users are tied to an id, atlassianid. I don't know what the problem of using an id is, but I'll take your word for it. I would definitely check the following URLs:

* <https://support.atlassian.com/jira-software-cloud/docs/smart-values-users/>
* <https://support.atlassian.com/jira-software-cloud/docs/automation-actions/>

If the response you are getting from the web request, is e.g. the author of a comment, then you can use another smart value, instead of the atlassianid.


author: Erin Quick-Laughlin
body: Thanks for the smart-values-users link - hadn't see that before. Helpful for the future!  

I think what I'm learning here is that there's no way to code the email address to trigger JA to look it up and associate the Atlassian ID.

If we were pulling this information from within Jira, this would definitely be much simpler. Unfortunately, we need a way to store \& retrieve users by a cross-index lookup of Product \& Department - so far, I only see external solutions for that (thus the web request). If anyone has other suggestions to keep this type of lookup within Jira, I'd love to hear it!


author: Kim Andersson
body: Hello! Did you manage to do anything good with this [@Erin Quick-Laughlin](/t5/user/viewprofilepage/user-id/4299733) ?   
I am fine with UserId, but in that case I would need a way of getting all of my users userId's in advance.