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.
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}}
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.
Hi @Quang Nguyen
What kind of form is this? Is this a native feature, or from an App?
Ste
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-..."
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
I have also tried the following, which generates the error "(Reporter is required. (reporter))"
It looks like you're new here. Sign in or register to get started.