Assign smart value to issue
Asked by Beata Borsos:

Hi All,

I would like to create an automation rule for a project.

I would like to achive that if our issue is transitioned from one column to another assign it to the user in the Bels? tan?csad? customfiled which is filled when the issue is created.

So I use the smart value (assign issue to-smart value) but it does not matter what I write into the ??user field?? my rule does not do anything. It does not fail (as i get email for every failing, in this case i don?t)but don?t do anything.

I would like the user in the bels? tan?csad? field automatically became the assignee.

I tried e.g. {{bels? tan?csad?.displayName}}, then without e.g., {{issue.bels? tan?csad?.displayName}}, {{issue.customfields_10049}}, and almost all kind of variaton of theese.

I would appriciate if you could help me.

Thank you all

Beata


Answers:
author: Stefan Salzl
body: Hi [@Beata Borsos](/t5/user/viewprofilepage/user-id/4962801)

As far as I know the assignee field needs to be set with the user?s accountID. So if your customfield is of type "user picker" the following smart value should do the work:

```
{{issue.customfield_xxx.accountId}}
```

If this doesn?t solve the problem please share a screenshot of your automation to provide more details for deeper analyze.

Best  
Stefan

comments: author: Beata Borsos
body: Hi Stefan,

So here is how my issue is field. You can see my user picker custom fields is filled with one of the jira user, and when i move my issue, I would like him (or any user in this field) to become the assignee.

Below you can see my rule, if that field is empty than assign it to me (this part works perfectly), if the filed is not empty, than assign it to the user already in the field.

Thanks,

![2022-07-11_10-27-18.png](https://community.atlassian.com/t5/image/serverpage/image-id/205390i42C10D446A828A92/image-size/large?v=v2&px=999 "2022-07-11_10-27-18.png")![2022-07-11_10-29-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/205391iB18487319B492B26/image-dimensions/555x264?v=v2 "2022-07-11_10-29-2.png")


author: Stefan Salzl
body: Hi [@Beata Borsos](/t5/user/viewprofilepage/user-id/4962801)

Thanks for sharing your automation rule here. In Automation for Jira the rule breaks if a condition doesn?t match. In this case every time the custom field is NOT empty the rule breaks.

To fullfill your requirement use an if/else clause instead of a simple condition and in the edit action use the above mentioned smart value. This should work fine then.

Please let me know if this was helpful.

Best  
Stefan


author: Beata Borsos
body: Hi Stefan,

Thank you, yes it worked,


author: Stefan Salzl
body: AWESOME ?? great to know it's working.


author: Tim C
body: Hi [@Beata Borsos](/t5/user/viewprofilepage/user-id/4962801)

I agree with [@Stefan Salzl](/t5/user/viewprofilepage/user-id/4616993) ... e.g. {{customfield_10049.accountId}} works fine for me.,

Notes:

"customfield_10049" (\& not "customfields_10049")

"accountId" (\& not "accountID").

comments: author: Beata Borsos
body: Hi Tim,

Maybe I am writing it in a wrong format? Can you check it because it still doesn?t work form me I think I make the mistake here now. I tried it without ?the issue.? as well...

![2022-07-11_11-05-25_3.png](https://community.atlassian.com/t5/image/serverpage/image-id/205402i152BEBBFBC677CB7/image-size/large?v=v2&px=999 "2022-07-11_11-05-25_3.png")


author: Tim C
body: Take off the "e. g." in the field box - it should just be the smart value.


author: Beata Borsos
body: Thank you for your help, it worked :)


author: Dan Tombs
body: Hi [@Beata Borsos](/t5/user/viewprofilepage/user-id/4962801)

To me it looks like you are using normal if statements over an else if. The normal if statements should only be used for items that always need to be true. You have two different options so use an else if.

Dan