Forums

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

How to get a accountId from a text user name in Jira automation

Alistair Adams April 20, 2022

I have an external tool that maps a user's name into a text field.

I have a Jira Automation that triggers when that field changes. I now want to take that text field and find the accountId so I can populate another field that is a user field.

Is this possible?

Something like:

{
"fields": {
"Program Manager": { "id": "{{fieldChange.toAccountId}}" }
}
}

except that there is no function toAccountId that I am aware of.

1 answer

0 votes
Darryl Lee
Community Champion
November 26, 2022

Hey I realize this is definitely a late response @Alistair Adams but while looking for something related I recently found this excellent article that answers your question (which also came up in my search):

Populate a user picker field from the description field 

I hope it's not too late to still help!

Derek Sheeman December 6, 2022

This solution only works for Cloud users.

Darryl Lee
Community Champion
December 6, 2022

Hi @Derek Sheeman 

You're right. This question was tagged cloud, so that's what my answer covers. 

Would you want this for Server/Data Center? Are you using Automation?

In which case you should be able to replace the API endpoint in the Web request in the example with something like this:

https://YOURJIRASERVER/rest/api/latest/user/search?username={{username.urlEncode}}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events