Forums

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

How to get accountId from a user email in automation

Brett Park May 30, 2022

I have an email form that comes into service desk. Using automation, I am parsing the email out and want to use it as the reporter. Currently, I can use the "Add service project customer" to create the customer and then assign them as the reporter. However, if the customer already exists, the call fails and I do not have the accountId.

How do I get the accountId of an existing customer via email to use in automation?

2 answers

1 accepted

1 vote
Answer accepted
Darryl Lee
Community Champion
November 25, 2022

Hey @Brett Park and @Chris I recently found an article that @Bruno Altenhofen from Atlassian wrote describing exactly how to get a accountID based on email, using the Web Request functionality of Automation:

https://community.atlassian.com/t5/Jira-Service-Management-articles/Populate-a-user-picker-field-from-the-description-field/ba-p/2134905

The tricky thing in your case @Brett Park is then using the above to see if the user already exists. I guess you could use a "Compare two values" condition and check if {{webhookResponses.first.body.accountId}} does not equal Empty.

I just tested this and it seems to work.

Chris Riffey
Contributor
December 9, 2022

I can confirm this method does work. Very helpful. 

Like Darryl Lee likes this
0 votes
Benjamin
Community Champion
May 30, 2022
Brett Park May 30, 2022

Thanks for the links. How is this done through an Automation? 

Benjamin
Community Champion
May 31, 2022

There's add on in Jira Cloud that can help with automating the parsing. For example, JEMH.

 

Just to take a step back. Doesn't the e-mail handler for the service desk already handle this. When an e-mail is sent to the service desk e-mail, it should parse the sender e-mail as the reporter as long as you have turn on public sign up.

 

https://confluence.atlassian.com/servicemanagementserver/receiving-requests-by-email-939926303.html

Brett Park June 1, 2022

We have a form that always sends from the same email address, but the actual sender's email is contained within the content. We need to check if that email has an account, and retrieve or create. ... the ability to create an account without knowing if one exists seems kind of like a pointless automation.

Chris Riffey
Contributor
November 11, 2022

Brett, did you ever get an answer to this? I have a very similar situation and all I can find are solutions of people asking why you don't do it a different way (that is not possible because the email is just text in an issue description). 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events