nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: jira-node/node-jira-client
Pull request #169 (2017-05-12 21:33:59)

Add getIssueProperty function
This function allows you to retrieve an issues property value using the
property key.  See API here
https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/properties-getProperty


Patch:
diff --git a/src/jira.js b/src/jira.js
index c3a6aa8..dd1d132 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -795,6 +795,20 @@ export default class JiraApi {
     }));
   }
 
+  /**
+   * @name getIssueProperty
+   * @function
+   * Get Property of Issue by Issue and Property Id
+   * [Jira Doc](https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/properties-getProperty)
+   * @param {string} issueNumber - The issue number to search for including the project key
+   * @param {string} property - The property key to search for
+   */
+  getIssueProperty(issueNumber, property) {
+    return this.doRequest(this.makeRequestHeader(this.makeUri({
+      pathname: `/issue/${issueNumber}/properties/${property}`,
+    })));
+  }
+
   /** List all priorities jira knows about
    * [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290489)
    * @name listPriorities


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index ed287b2..f65dc92 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -580,6 +580,11 @@ describe('Jira API Tests', () => {
       });
     });
 
+    it('getIssueProperty hits proper url with expansion', async () => {
+      const result = await dummyURLCall('getIssueProperty', ['PK-100', 'somePropertyKey']);
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/PK-100/properties/somePropertyKey');
+    });
+
     it('listPriorities hits proper url', async () => {
       const result = await dummyURLCall('listPriorities', []);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/priority');
Repository: jira-node/node-jira-client
Pull request #229 (2018-06-29 16:48:57)

modified signature of updateIssue to be able to write to query string
#228


Patch:
diff --git a/src/jira.js b/src/jira.js
index 70f12c9..60e0bb8 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -696,10 +696,12 @@ export default class JiraApi {
    * @function
    * @param {string} issueId - the Id of the issue to delete
    * @param {object} issueUpdate - update Object as specified by the rest api
+   * @param {object} query - adds parameters to the query string
    */
-  updateIssue(issueId, issueUpdate) {
+  updateIssue(issueId, issueUpdate, query = {}) {
     return this.doRequest(this.makeRequestHeader(this.makeUri({
       pathname: `/issue/${issueId}`,
+      query,
     }), {
       body: issueUpdate,
       method: 'PUT',


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 9975fc8..a5764fe 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -561,6 +561,11 @@ describe('Jira API Tests', () => {
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/MI-6');
     });
 
+    it('properly creates query params for updateIssue', async () => {
+      const result = await dummyURLCall('updateIssue', ['MI-6', 'someInfo', { notifyUsers: true }]);
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/MI-6?notifyUsers=true');
+    });
+
     it('listComponents hits proper url', async () => {
       const result = await dummyURLCall('listComponents', ['ProjectName']);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/project/ProjectName/components');
Repository: jira-node/node-jira-client
Pull request #243 (2019-02-02 06:32:09)

Add getIssueChangelog method
- Add missing tests from https://github.com/jira-node/node-jira-client/pull/206
- Rename `getIssueChangeLog` to `getIssueChangelog` to follow the Jira documentation
![image](https://user-images.githubusercontent.com/3654180/52160838-43560800-26f7-11e9-9a86-a3f8f0797feb.png)
![image](https://user-images.githubusercontent.com/3654180/52160839-45b86200-26f7-11e9-93ff-a97877c28eb5.png)



Patch:
diff --git a/src/jira.js b/src/jira.js
index 2ecc5af..775d3ce 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -919,6 +919,19 @@ export default class JiraApi {
     })));
   }
 
+  /**
+   * @name getIssueChangelog
+   * @function
+   * List all changes for an issue, sorted by date, starting from the latest
+   * [Jira Doc](https://docs.atlassian.com/jira/REST/cloud/#api/2/issue/{issueIdOrKey}/changelog)
+   * @param {string} issueNumber - The issue number to search for including the project key
+   */
+  getIssueChangelog(issueNumber) {
+    return this.doRequest(this.makeRequestHeader(this.makeUri({
+      pathname: `/issue/${issueNumber}/changelog`,
+    })));
+  }
+
   /**
    * @name getIssueWatchers
    * @function


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 00f94cc..7c882b7 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -556,6 +556,11 @@ describe('Jira API Tests', () => {
       result.should.eql('John Smith');
     });
 
+    it('getIssueChangelog hits proper url', async () => {
+      const result = await dummyURLCall('getIssueChangelog', ['ZQ-9001']);
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/ZQ-9001/changelog');
+    });
+
     it('getIssueWatchers hits proper url', async () => {
       const result = await dummyURLCall('getIssueWatchers', ['ZQ-9001']);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/ZQ-9001/watchers');
Repository: jira-node/node-jira-client
Pull request #244 (2019-02-16 17:34:18)

Add getServerInfo method
https://github.com/jira-node/node-jira-client/pull/200


Patch:
diff --git a/src/jira.js b/src/jira.js
index 58d270d..fde9e5b 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -1699,4 +1699,16 @@ export default class JiraApi {
       body,
     }));
   }
+
+  /**
+   * @name getServerInfo
+   * @function
+   * Get server info
+   * [Jira Doc](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-api-2-serverInfo-get)
+   */
+  getServerInfo() {
+    return this.doRequest(this.makeRequestHeader(this.makeUri({
+      pathname: '/serverInfo',
+    })));
+  }
 }


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 7c882b7..f6968e4 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -894,5 +894,10 @@ describe('Jira API Tests', () => {
       const result = await dummyURLCall('issueNotify', ['someIssueId', {}]);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/someIssueId/notify');
     });
+
+    it('getServerInfo hits proper url', async () => {
+      const result = await dummyURLCall('getServerInfo');
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/serverInfo');
+    });
   });
 });
Repository: jira-node/node-jira-client
Pull request #246 (2019-02-22 01:36:48)

Added endpoint for list of worklogs by issueId
Adding and deleting a worklog already existed, but getting a list of worklogs for a given issue was missing, which is really handy. This just adds a function to GET from the existing JIRA endpoint.


Patch:
diff --git a/src/jira.js b/src/jira.js
index 7a18e5b..93aef4f 100644
--- a/src/jira.js
+++ b/src/jira.js
@@ -1106,6 +1106,20 @@ export default class JiraApi {
     ));
   }
 
+  /** Get worklogs list from a given issue
+   * [Jira Doc](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-api-3-issue-issueIdOrKey-worklog-get)
+   * @name getIssueWorklogs
+   * @function
+   * @param {string} issueId - the Id of the issue to find worklogs for
+   */
+  getIssueWorklogs(issueId) {
+    return this.doRequest(this.makeRequestHeader(
+      this.makeUri({
+        pathname: `/issue/${issueId}/worklog`,
+      }),
+    ));
+  }
+
   /** List all Issue Types jira knows about
    * [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id295946)
    * @name listIssueTypes


Test patch:
diff --git a/test/jira-tests.js b/test/jira-tests.js
index 40dd2c1..d070685 100644
--- a/test/jira-tests.js
+++ b/test/jira-tests.js
@@ -704,6 +704,11 @@ describe('Jira API Tests', () => {
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/someIssueNumber/worklog/someWorklogId');
     });
 
+    it('getIssueWorklogs hits proper url', async () => {
+      const result = await dummyURLCall('getIssueWorklogs', ['someIssueNumber']);
+      result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issue/someIssueNumber/worklog');
+    });
+
     it('listIssueTypes hits proper url', async () => {
       const result = await dummyURLCall('listIssueTypes', []);
       result.should.eql('http://jira.somehost.com:8080/rest/api/2.0/issuetype');