Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Set Reporter as same user in Web Submitter Email

Quang Nguyen July 26, 2023

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.

2 answers

1 accepted

0 votes
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 15, 2023

Hello again @Quang Nguyen -

I believe you're on Data Center, and previously 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 action to talk to the Jira API, as described here: How to extend Automation for Jira with REST API calls 

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 

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 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.

0 votes
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 30, 2023

Hi @Quang Nguyen 

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

Ste

Quang Nguyen July 31, 2023

Hi @Ste Wright 

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

Quang Nguyen July 31, 2023

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 :) 

Quang Nguyen August 1, 2023

I have also tried the following, which generates the error "(Reporter is required. (reporter))"

Capture.PNG

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 1, 2023

Hi @Quang Nguyen 

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

Quang Nguyen August 1, 2023

Hi Stephen,

When I tried this I got the error:

"Error editing issues

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
Here is the screenshot of my setting:2023-07-26_13h34_14.png
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 3, 2023

Hi @Quang Nguyen 

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

Ste

Quang Nguyen August 3, 2023

Hi @Ste Wright ,

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.

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 4, 2023

Hi @Quang Nguyen 

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events