-
Suggestion
-
Resolution: Unresolved
-
None
Problem
A4J is currently unable to set reporter using email address when using 'Edit Issue' action
- Set up a rule using 'Edit Issue' and use the following JSON
{ "update": { "reporter": [ { "set": { "emailAddress": "<email address>"} } ] } }
Replace <email address> accordingly
- Run the rule
- Audit logs show field is successfully edited despite not actually working. Reporter is completely removed instead of being updated.
This is expected behaviour as per our REST API documentation
- https://docs.atlassian.com/software/jira/docs/api/REST/9.11.0/#api/2/issue-editIssue
- https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-edit-issues-6291632/#field-meta-data
The fields that can be updated, in either the fields parameter or the update parameter, can be determined using the /rest/api/2/issue/{issueIdOrKey}/editmeta resource.
When running the suggested REST call to get the editable metadata for any custom issue we get the following response for the reporter:
"reporter": { "required": true, "schema": { "type": "user", "system": "reporter" }, "name": "Reporter", "fieldId": "reporter", "autoCompleteUrl": "http://localhost:2990/jira/rest/api/latest/user/search?username=", "operations": [ "set" ]
Suggested Solution
Allow A4J to set reporter using email address, instead of only username.
Why This Is Important
It is common for A4J to work with email addresses from text fields. There are times where reporter needs to be set based on these email addresses.
Workaround
- Set the reporter using username instead.
- Use 'Send web request' to perform a user search based on the email address: Find users - GET /rest/api/2/user/search. Retrieve the username of the user with the response and use that to update the reporter field. Refer to How to extend Automation for Jira with REST API calls on how to perform REST API with automation
- links to