I am doing a post function to send email notifications. I have added submitter and a specific user. However I still get error: Incorrect request: ["No recipients were defined for notification."]
What am I missing? Is this a BUG?
The API call has reporer: false
But the Post-function has it as true:
Dump:
[2022-01-24T09:17:52.398Z] ERROR: mwec/4 on 5e76f995-e123-40c8-99b7-11c5008008a5: Incorrect request: ["No recipients were defined for notification."] (targetIssue=SDATRQ-897, msgType=workflow-error, postFunctionId=826b4a6a-9ba5-4d12-8727-0d843a72e62d, during=post-function-execution, clientSEN=SEN-17121897, postFunction=EmailIssueFunction, clientKey=5ad61939-0a4d-3c84-9adf-88a7b277ebd0, requestId=22ff3c86-c540-4643-89bc-cda2ecddce6a, issueKey=SDATRQ-897, clientUrl=https://equinixjira.atlassian.net, accountType=atlassian, accountId=5f044573502ce1001dccc9ec, queue=triggered) request: { "method": "POST", "impersonate": "5f044573502ce1001dccc9ec", "href": "https://equinixjira.atlassian.net/rest/api/2/issue/SDATRQ-897/notify", "body": "{\"subject\":\"SDAT CR submitted for approval: Test no 4\",\"htmlBody\":\"<p>Dear Approver</p><p>A new SDAT Change Request has been submitted for your review and approval.</p><p>Submitter: Kenneth Olsson<br>Summary: Test no 4<br>Change Reason: Upgrade, New Functionality<br>Urgency: HIGH<br>Description: This is the description</p><p>Link: https://equinixjira.atlassian.net/browse/SDATRQ-897</p><p>ACTION: Please go into Jira to review and approve.</p><p>SDAT email Deamon</p>\",\"textBody\":\"Dear Approver\\n\\nA new SDAT Change Request has been submitted for your review and approval.\\n\\nSubmitter: Kenneth Olsson\\nSummary: Test no 4\\nChange Reason: Upgrade, New Functionality\\nUrgency: HIGH\\nDescription: This is the description\\n\\nLink: https://equinixjira.atlassian.net/browse/SDATRQ-897\\n\\nACTION: Please go into Jira to review and approve.\\n\\nSDAT email Deamon\",\"to\":{\"reporter\":false,\"assignee\":false,\"watchers\":false,\"voters\":false,\"users\":[{\"accountId\":\"5f044573502ce1001dccc9ec\"}]}}" } -- configuration: { "runAs": "accountId:5f044573502ce1001dccc9ec", "runAsType": "thisUser", "toReporter": true, "subject": "SDAT CR submitted for approval: {{ targetIssue.fields.summary }}", "conditionalExecution": false, "toVoters": false, "textBody": "Dear Approver\n\nA new SDAT Change Request has been submitted for your review and approval.\n\nSubmitter: {{ issue.fields.reporter.displayName }}\nSummary: {{ targetIssue.fields.summary }}\nChange Reason: {{issue.fields.customfield_13426 | join(\", \" , \"value\")}}\nUrgency: {{ issue.fields.customfield_13391.value }}\nDescription: {{ targetIssue.fields.description }}\n\nLink: https://equinixjira.atlassian.net/browse/{{ issue.key }}\n\nACTION: Please go into Jira to review and approve.\n\nSDAT email Deamon", "toAssignee": false, "_modified": "2022-01-24T09:12:37.684Z", "toUsers": "accountId:5f044573502ce1001dccc9ec", "toWatchers": false } -- error: { "code": 400, "responseHeaders": { "x-arequestid": "1805fe81-826d-49ca-baa3-1e746c2296a4", "x-aaccountid": "5f044573502ce1001dccc9ec", "atl-traceid": "79c75afeffece399" }, "codeString": "400", "name": "Error", "detail": { "errorMessages": [ "No recipients were defined for notification." ] }, "message": "Unexpected response: 400", "fields": "{\"responseHeaders\":{\"atl-traceid\":\"79c75afeffece399\",\"x-arequestid\":\"1805fe81-826d-49ca-baa3-1e746c2296a4\",\"x-aaccountid\":\"5f044573502ce1001dccc9ec\"}}" }
Hi Kenneth,
Is there a reason you have do to it as a post function and not use Automation for Jira?
Alternatively, if you want more ability to theme / control the email check out Notification Assistant for Jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems more clean and straight forward to use a built in email notification in the post functions. I assumed this was what the intent of the function. But if this one do not work then I would have to revert to a automation.
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.