How can I automatically change a user field using an email address from the description?

John Gasper May 11, 2022

Hey All,

 

Here's the situation: we have an external form that anyone can fill out. It collects a name, email address, phone number, and a comment. This information is then emailed to our JSM project by a standard emailer.image of desc.png

 

Since the standard emailer is the received email address, it becomes the reporter (not shown in image). However, we want the email field in the form to become the reporter.(helloworld@example.com). 

 

I'm using Automation to try to accomplish this. I create a variable to parse the email out.

`{{issue.description.substringBetween("Email : ","Phone #:")}}

automation screenshot.png

Then I edit the issue using the advanced option.

{
"fields": {
"reporter": "{{reporteremailaddress}}"
}

automation screenshot2.png

However, I'm not having much success, and I think it's because of the info pane in this Atlassian support article. "Due to recent GDPR changes, referencing user fields (such as reporter, assignee) now require the property id to be set with a user's account ID rather than using name."

 

Is there a way to make the email address the reporter? Or create and then pull an accountId from an email address? 

 

Am I going about this all wrong and there is a much easier way to change the reporter?

Thank you for your help!

2 answers

1 vote
Garrett McCreery
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 11, 2022

Hello John!

My first question:

Is the user that is filling out the form with their email address (helloworld@example.com) already a user in Atlassian? They would need to have an Atlassian account to be able to be the Reporter.

Let's start there. Let me know,

John Gasper May 12, 2022

Hi Garrett!

Thanks for reaching out! The helloworld@example.com user sends in a request form that gets formated as text and send via email to our JSM project email address. This request form is NOT a Jira form; it is just a standard web form that lives on our website. The data (which includes name, phone number, email address, and message) are sent in the body of the email.

This email is sent by a fixed web mailer with an email address that is always the same. This web mailer is our "customer". We want the email address in the body to either:

  1. create a new customer and assign it to the new customer or
  2. search for and assign it to the existing customer

 

I've figured out how to accomplish option #1 using the details from Solved: How to get <username> after "Add new Service Desk ... (atlassian.com). It is depicted in photos #1-#3.

variable.pngnew_customer.pngedit issue.png

I haven't figured out how to change the reporter to an existing customer based on an email address. It doesn't look like Automation has a programmatic way to lookup a user's account id based on email -- just the manual/static way.

lookup.png

 

Edit: formatting.

0 votes
Jon Irusta October 3, 2023

We are facing the same issue and it would be really useful for as getting to know how to solve this. 

I hope that someone can enlighten us! 

Suggest an answer

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

Atlassian Community Events