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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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-..."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have also tried the following, which generates the error "(Reporter is required. (reporter))"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked for me - what I did was:
For reference, I used a text field to store the email address - is that the same as your custom field?
Ste
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephen,
When I tried this I got the error:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.