Repository: jira-node/node-jira-client (js)

Issue:
updateAssignee uses deprecated format
updateAssignee uses the format { name: assigneeName }, but using name is deprecated.
Instead the userId should be used. [Jira doc](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-assignee-put)

Pull request description:
Change assignee based on accountId instead of name
Closes #281 

Patch:
diff --git a/src/jira.js b/src/jira.js
index 1e7b6fe..1a5df0b 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -788,6 +788,23 @@ export default class JiraApi {
     }));
   }
 
+  /** Change an assignee on an issue
+   * [Jira Doc](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-issueIdOrKey-assignee-put)
+   * @name updateAssigneeWithId
+   * @function
+   * @param {string} issueKey - the key of the existing issue
+   * @param {string} userId - the jira username to add as a new assignee to the issue
+   */
+  updateAssigneeWithId(issueKey, userId) {
+    return this.doRequest(this.makeRequestHeader(this.makeUri({
+      pathname: `/issue/${issueKey}/assignee`,
+    }), {
+      method: 'PUT',
+      followAllRedirects: true,
+      body: { accountId: userId },
+    }));
+  }
+
   /** Delete issue from Jira
    * [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290791)
    * @name deleteIssue


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 240c930..8bf45bb 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -596,6 +596,11 @@ describe('Jira API Tests', () => {
       const result = await dummyURLCall('updateAssignee', ['ZQ-9001', 'Assignee']);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/ZQ-9001/assignee');
     });
+    
+    it('updateAssigneeWithId hits proper url', async () => {
+      const result = await dummyURLCall('updateAssigneeWithId', ['ZQ-9001', 'Assignee']);
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/ZQ-9001/assignee');
+    });
 
     it('deleteIssue hits proper url', async () => {
       const result = await dummyURLCall('deleteIssue', ['FU-69']);