Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect request: ["No recipients were defined for notification."]

Kenneth Olsson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2022

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

 

Method:POST
Data:
Object
subject:"Approved"
htmlBody:"<p>The issue has been approved</p>"
textBody:"The issue has been approved"
to:Object
reporter:false
assignee:false
watchers:false
voters:false
users:Array[1]
0:Object
accountId:"5f044573502ce1001dccc9ec"

But the Post-function has it as true:

 

Post-function:Email issue(s)
Transition:submitted to approved (from status Submitted to status Approved) of workflow Software Simplified Workflow for Project GNSDATREQ - CMR
Configuration:
Object
runAsType:"currentUser"
toReporter:true
subject:"Approved"
conditionalExecution:false
toVoters:false
textBody:"The issue has been approved"
toAssignee:false
_modified:"2022-01-24T16:30:27.372Z"
toWatchers:false

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\"}}"
    }

 

1 answer

0 votes
John Funk
Community Champion
January 24, 2022

Hi Kenneth,

Is there a reason you have do to it as a post function and not use Automation for Jira? 

Boris Berenberg - Atlas Authority
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 24, 2022

Alternatively, if you want more ability to theme / control the email check out Notification Assistant for Jira

Kenneth Olsson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 24, 2022

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.

Suggest an answer

Log in or Sign up to answer