I have been successful in pulling the name from description information where the name is in a table field
Example information
I have an automation set to set the Reporter field to the following
{{issue.description.match("Requestor:\\s*([^|\\n\\r]+)\\s*(?=\\||\\n|\\r|$)").trim}}
I have confirmed via logging that it is pulling the name without spaces correctly using the above code and in the above description example it gives "Mark Dodd" without the quotes.
But it is just setting the reporter to Anonymous and I can't figure out why.
Morning @Mark Dodd ,
Welcome to the community!
When setting the reporter field (or any other user object field), I believe it only accepts Atlassian account IDs. When invalid data is used, it defaults to Anonymous.
Thanks!
Brandon
is there anyway to look up a users ID based upon the name.
I just assumed it would take the name as when you paste in a name to the field it finds the person.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark, Brandon's right about the root cause — Reporter (and any user-picker field) only accepts an Atlassian accountId, not a display name. Feed it something else and Jira silently falls back to Anonymous instead of erroring, which is why your rule "runs" but the field's wrong.
To answer your follow-up — yes, you can resolve a name to an accountId inside the same rule:
https://<your-site>.atlassian.net/rest/api/3/user/search?query={{issue.description.match("Requestor:\\s*([^|\\n\\r]+)\\s*(?=\\||\\n|\\r|$)").trim.urlEncode}}{{webhookResponse.body.first.accountId}}.One caveat before you ship it: .first on a fuzzy match can silently grab the wrong person if two people share a similar name. If the description ever has an email instead of just a name, match on email — far less likely to collide. If you're stuck with just a name, add a guard (webhookResponse.body.size == 1) so an ambiguous match fails loudly instead of quietly misassigning the reporter. Atlassian's own doc on this exact pattern confirms there's no built-in name→accountId smart value — the REST lookup is the way: support.atlassian.com/cloud-automation/docs/convert-usernames-to-account-ids/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
after a bit of trial and error (had to work out authentication) I have this working now using the rest api.
Thanks for both of you for the assistance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That action sounds great, but our Jira Cloud Premium does not have it - under Jira section in automation I have just: Lookup work items
Any idea why I cannot see this action?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.