Set Reporter as same user in Web Submitter Email
Asked by Quang Nguyen:

When a form in Jira is submitted, the default value for Reporter is "submit". I would like to create an automation rule to update the Reporter to the actual person submitting these forms.

There is a Web Submitter Email in the form of an email address. Can I somehow match the Reporter name to that?

I found a similar issue at <https://community.atlassian.com/t5/Jira-Core-Server-questions/Change-Reporter-using-Automation/qaq-p/1004793>, but I don't know enough about APIs. Specifically I am stuck at the "**Email** : The email you want the accountId for" part of the accepted answer.


Answers:
author: Darryl Lee
body: Hello again [@Quang Nguyen](/t5/user/viewprofilepage/user-id/5277828) -

I believe you're on Data Center, and [previously](https://community.atlassian.com/t5/Automation-questions/Extract-email-address-from-comment/qaq-p/2471561) we discussed that your username is **nguyenq**.

So the problem is that your field "Web Submitter Email" is an email address, which does not match the username.

That's why you will need to do something **similar** to the instructions you linked to, which is looking up the username based on email address. Unfortunately those instructions are for Jira Cloud, which has a different API than Data Center.

Basically you need to use the [Web Request](https://confluence.atlassian.com/automation074/actions-1141481289.html#Actions-sendwebrequest)[action](https://confluence.atlassian.com/automation074/actions-1141481289.html#Actions-sendwebrequest) to talk to the Jira API, as described here: [How to extend Automation for Jira with REST API calls](https://confluence.atlassian.com/automationkb/how-to-extend-automation-for-jira-with-rest-api-calls-1021217952.html)

The API call you'll need to make is:

```
https://YOURSITE/rest/api/2/groupuserpicker?query={{issue.customfield_10402}}
```

* You will be use the GET HTTP method, not PUT.
* You should check the box for "Delay execution of subsequent rule actions..."
* You do not need to send any Custom Data, as the URL contains the email you are looking up in {{issue.customfield_10402}}

The username will be returned in the [webhookResponse data](https://confluence.atlassian.com/automation074/send-web-request-action-now-provides-response-data-1141481224.html)

And then you'll be able to set the Reporter to this value:

```
{{webhookResponse.body.users.users.first.name}}
```

(Well, in theory. I haven't tested this. You may have to do some [debugging](https://confluence.atlassian.com/automation/debug-your-first-automation-rule-993924612.html) to ensure that you're getting the right values.)

Also, you can look at what data the API returns by going to the URL in a browser:

<https://YOURSITE/rest/api/2/groupuserpicker?query=testemail@address.com>

As always, give it a try, put in Audit Logging, and send screenshots if you run into issues.


author: Ste Wright
body: Hi [@Quang Nguyen](/t5/user/viewprofilepage/user-id/5277828)

What kind of form is this? Is this a native feature, or from an App?

Ste

comments: author: Quang Nguyen
body: Hi [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470)

Thanks for replying. I'm not sure if this is a native feature. Here is a screenshot of the form. The URL of the form begins with "<https://jiradashboard-git-jira-dashboard.eu-de->..."![2023-07-31_14h36_09.png](https://community.atlassian.com/t5/image/serverpage/image-id/272285i764E34BF922612A5/image-size/large?v=v2&px=999 "2023-07-31_14h36_09.png")


author: Quang Nguyen
body: I found out that the Web Submitter Email, which has the correct name of the person I want to set as the reporter, is a custom field with title "customfield_10403"

I've tried the following code, but it is generating an error "Error while parsing additional fields. Not valid JSON."

```
{
"fields": {
"reporter": {{customfield_10403}}
}
}
```

Apologies if this is really basic stuff, I am not a programmer, just someone trying to figure this out :)


author: Quang Nguyen
body: I have also tried the following, which generates the error "(Reporter is required. (reporter))"

![Capture.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/272350iED8C852662B6E28E/image-size/large?v=v2&px=999 "Capture.PNG")


author: Ste Wright
body: Hi [@Quang Nguyen](/t5/user/viewprofilepage/user-id/5277828)

It worked for me - what I did was:

* Chose the Reporter field from the dropdown, rather than using the "Additional fields" section
* Entered the smart value as - {{issue.customfield_10402}} into that field

For reference, I used a text field to store the email address - is that the same as your custom field?

Ste


author: Quang Nguyen
body: Hi Stephen,

When I tried this I got the error:  

#### "Error editing issues {#toc-hId-260970419}

IFXACS-388 (The reporter specified is not a user. (reporter))"  
customfield_10402 is the text field "Web Submitter Email", clicking on it hyperlinks to sending them an email in my mail client.  
customfield_10403 is the field containing their name and employee designation. I have tried both and they generate the same error.  
![2023-07-31_14h36_09.png](https://community.atlassian.com/t5/image/serverpage/image-id/272537i022213BFA142B46A/image-size/large?v=v2&px=999 "2023-07-31_14h36_09.png")  
Here is the screenshot of my setting:![2023-07-26_13h34_14.png](https://community.atlassian.com/t5/image/serverpage/image-id/272539iEBA18666C356D449/image-size/large?v=v2&px=999 "2023-07-26_13h34_14.png")


author: Ste Wright
body: Hi [@Quang Nguyen](/t5/user/viewprofilepage/user-id/5277828)

Is that user a licensed member of Jira for your company?

Ste


author: Quang Nguyen
body: Hi [@Ste Wright](/t5/user/viewprofilepage/user-id/1166470) ,

Apologies, the screenshot was to show the type of data in each customfield. I have been test submitting the forms to see if the automation works, so my email and name would be the one in Web Submitter Email and Web Submitter Name. I am a licensed member for my company, since I am setting up the automation.


author: Ste Wright
body: Hi [@Quang Nguyen](/t5/user/viewprofilepage/user-id/5277828)

Try creating an Issue and manually entering the email address into a single-line text field, and see if it works.

That'll help clarify if it's an issue with the form or the rule :)

Ste