49
49
// * `Jira API Version<string>`: Known to work with `2` and `2.0.alpha1`
50
50
// * `verbose<bool>`: Log some info to the console, usually for debugging
51
51
// * `strictSSL<bool>`: Set to false if you have self-signed certs or something non-trustworthy
52
- // * `oauth`: A disctionary of `consumer_key`, `consumer_secret`, `access_token` and `access_token_secret` to be used for OAuth authentication.
52
+ // * `oauth`: A dictionary of `consumer_key`, `consumer_secret`, `access_token` and `access_token_secret` to be used for OAuth authentication.
53
53
//
54
54
// ## Implemented APIs ##
55
55
//
@@ -249,7 +249,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
249
249
// * count: count of unresolved issues for requested version
250
250
//
251
251
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id288524)
252
-
253
252
this . getUnresolvedIssueCount = function ( version , callback ) {
254
253
var options = {
255
254
rejectUnauthorized : this . strictSSL ,
@@ -291,7 +290,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
291
290
// * project: the json object representing the entire project
292
291
//
293
292
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id289232)
294
-
295
293
this . getProject = function ( project , callback ) {
296
294
297
295
var options = {
@@ -391,7 +389,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
391
389
/**
392
390
* Returns a list of sprints belonging to a Rapid View.
393
391
*
394
- * @param rapidView ID
392
+ * @param rapidViewId
395
393
* @param callback
396
394
*/
397
395
this . getLastSprintForRapidView = function ( rapidViewId , callback ) {
@@ -443,8 +441,8 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
443
441
/**
444
442
* Returns sprint and issues information
445
443
*
446
- * @param rapidView ID
447
- * @param sprint ID
444
+ * @param rapidViewId
445
+ * @param sprintId
448
446
* @param callback
449
447
*/
450
448
this . getSprintIssues = function getSprintIssues ( rapidViewId , sprintId , callback ) {
@@ -565,8 +563,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
565
563
* }
566
564
*
567
565
* @param link
568
- * @param errorCallback
569
- * @param successCallback
566
+ * @param callback
570
567
*/
571
568
this . issueLink = function ( link , callback ) {
572
569
@@ -611,7 +608,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
611
608
// * versions: array of the versions for a product
612
609
//
613
610
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id289653)
614
-
615
611
this . getVersions = function ( project , callback ) {
616
612
617
613
var options = {
@@ -784,7 +780,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
784
780
// * issues: array of issues for the user
785
781
//
786
782
// [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id333082)
787
- //
788
783
this . searchJira = function ( searchString , optional , callback ) {
789
784
// backwards compatibility
790
785
optional = optional || { } ;
@@ -949,17 +944,18 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
949
944
950
945
} ) ;
951
946
} ;
952
- // ## Delete issue to Jira ##
953
- // ### Takes ###
954
- //
955
- // * issueId: the Id of the issue to delete
956
- // * callback: for when it's done
957
- //
958
- // ### Returns ###
959
- // * error string
960
- // * success object
961
- //
962
- // [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290791)
947
+
948
+ // ## Delete issue to Jira ##
949
+ // ### Takes ###
950
+ //
951
+ // * issueId: the Id of the issue to delete
952
+ // * callback: for when it's done
953
+ //
954
+ // ### Returns ###
955
+ // * error string
956
+ // * success object
957
+ //
958
+ // [Jira Doc](http://docs.atlassian.com/jira/REST/latest/#id290791)
963
959
this . deleteIssue = function ( issueNum , callback ) {
964
960
var options = {
965
961
rejectUnauthorized : this . strictSSL ,
@@ -985,6 +981,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
985
981
986
982
} ) ;
987
983
} ;
984
+
988
985
// ## Update issue in Jira ##
989
986
// ### Takes ###
990
987
//
@@ -1264,6 +1261,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1264
1261
1265
1262
} ) ;
1266
1263
} ;
1264
+
1267
1265
// ## Transition issue in Jira ##
1268
1266
// ### Takes ###
1269
1267
//
@@ -1354,6 +1352,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1354
1352
1355
1353
} ) ;
1356
1354
} ;
1355
+
1357
1356
// ## Add a comment to an issue ##
1358
1357
// ### Takes ###
1359
1358
// * issueId: Issue to add a comment to
@@ -1394,6 +1393,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1394
1393
}
1395
1394
} ) ;
1396
1395
} ;
1396
+
1397
1397
// ## Add a worklog to a project ##
1398
1398
// ### Takes ###
1399
1399
// * issueId: Issue to add a worklog to
@@ -1434,8 +1434,8 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1434
1434
*/
1435
1435
this . addWorklog = function ( issueId , worklog , newEstimate , callback ) {
1436
1436
if ( typeof callback == 'undefined' ) {
1437
- callback = newEstimate
1438
- newEstimate = false
1437
+ callback = newEstimate ;
1438
+ newEstimate = false ;
1439
1439
}
1440
1440
var options = {
1441
1441
rejectUnauthorized : this . strictSSL ,
@@ -1470,6 +1470,7 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1470
1470
1471
1471
} ) ;
1472
1472
} ;
1473
+
1473
1474
// ## List all Issue Types ##
1474
1475
// ### Takes ###
1475
1476
//
@@ -1690,7 +1691,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1690
1691
} ) ;
1691
1692
} ;
1692
1693
1693
-
1694
1694
// ## Describe the currently authenticated user ##
1695
1695
// ### Takes ###
1696
1696
//
@@ -1715,7 +1715,6 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1715
1715
* }
1716
1716
* }
1717
1717
*/
1718
-
1719
1718
this . getCurrentUser = function ( callback ) {
1720
1719
var options = {
1721
1720
rejectUnauthorized : this . strictSSL ,
@@ -1742,94 +1741,94 @@ var JiraApi = exports.JiraApi = function(protocol, host, port, username, passwor
1742
1741
} ;
1743
1742
1744
1743
// ## Retrieve the backlog of a certain Rapid View ##
1745
- // ### Takes ###
1746
- // * rapidViewId: rapid view id
1747
- // * callback: for when it's done
1748
- //
1749
- // ### Returns ###
1750
- // * error string
1751
- // * backlog object
1752
- /*
1753
- * Backlog item is in the format:
1754
- * {
1755
- * "sprintMarkersMigrated": true,
1756
- * "issues": [
1757
- * {
1758
- * "id": 67890,
1759
- * "key": "KEY-1234",
1760
- * "summary": "Issue Summary",
1761
- * ...
1762
- * }
1763
- * ],
1764
- * "rankCustomFieldId": 12345,
1765
- * "sprints": [
1766
- * {
1767
- * "id": 123,
1768
- * "name": "Sprint Name",
1769
- * "state": "FUTURE",
1770
- * ...
1771
- * }
1772
- * ],
1773
- * "supportsPages": true,
1774
- * "projects": [
1775
- * {
1776
- * "id": 567,
1777
- * "key": "KEY",
1778
- * "name": "Project Name"
1779
- * }
1780
- * ],
1781
- * "epicData": {
1782
- * "epics": [
1783
- * {
1784
- * "id": 9876,
1785
- * "key": "KEY-4554",
1786
- * "typeName": "Epic",
1787
- * ...
1788
- * }
1789
- * ],
1790
- * "canEditEpics": true,
1791
- * "supportsPages": true
1792
- * },
1793
- * "canManageSprints": true,
1794
- * "maxIssuesExceeded": false,
1795
- * "queryResultLimit": 2147483647,
1796
- * "versionData": {
1797
- * "versionsPerProject": {
1798
- * "567": [
1799
- * {
1800
- * "id": 8282,
1801
- * "name": "Version Name",
1802
- * ...
1803
- * }
1804
- * ]
1805
- * },
1806
- * "canCreateVersion": true
1807
- * }
1808
- * }
1809
- */
1810
- this . getBacklogForRapidView = function ( rapidViewId , callback ) {
1811
- var options = {
1812
- rejectUnauthorized : this . strictSSL ,
1813
- uri : this . makeUri ( '/xboard/plan/backlog/data?rapidViewId=' + rapidViewId , 'rest/greenhopper/' ) ,
1814
- method : 'GET' ,
1815
- json : true
1816
- } ;
1817
-
1818
- this . doRequest ( options , function ( error , response ) {
1819
- if ( error ) {
1820
- callback ( error , null ) ;
1821
-
1822
- return ;
1823
- }
1824
-
1825
- if ( response . statusCode === 200 ) {
1826
- callback ( null , response . body ) ;
1827
-
1828
- return ;
1829
- }
1830
-
1831
- callback ( response . statusCode + ': Error while retrieving backlog' ) ;
1832
- } ) ;
1833
- } ;
1744
+ // ### Takes ###
1745
+ // * rapidViewId: rapid view id
1746
+ // * callback: for when it's done
1747
+ //
1748
+ // ### Returns ###
1749
+ // * error string
1750
+ // * backlog object
1751
+ /*
1752
+ * Backlog item is in the format:
1753
+ * {
1754
+ * "sprintMarkersMigrated": true,
1755
+ * "issues": [
1756
+ * {
1757
+ * "id": 67890,
1758
+ * "key": "KEY-1234",
1759
+ * "summary": "Issue Summary",
1760
+ * ...
1761
+ * }
1762
+ * ],
1763
+ * "rankCustomFieldId": 12345,
1764
+ * "sprints": [
1765
+ * {
1766
+ * "id": 123,
1767
+ * "name": "Sprint Name",
1768
+ * "state": "FUTURE",
1769
+ * ...
1770
+ * }
1771
+ * ],
1772
+ * "supportsPages": true,
1773
+ * "projects": [
1774
+ * {
1775
+ * "id": 567,
1776
+ * "key": "KEY",
1777
+ * "name": "Project Name"
1778
+ * }
1779
+ * ],
1780
+ * "epicData": {
1781
+ * "epics": [
1782
+ * {
1783
+ * "id": 9876,
1784
+ * "key": "KEY-4554",
1785
+ * "typeName": "Epic",
1786
+ * ...
1787
+ * }
1788
+ * ],
1789
+ * "canEditEpics": true,
1790
+ * "supportsPages": true
1791
+ * },
1792
+ * "canManageSprints": true,
1793
+ * "maxIssuesExceeded": false,
1794
+ * "queryResultLimit": 2147483647,
1795
+ * "versionData": {
1796
+ * "versionsPerProject": {
1797
+ * "567": [
1798
+ * {
1799
+ * "id": 8282,
1800
+ * "name": "Version Name",
1801
+ * ...
1802
+ * }
1803
+ * ]
1804
+ * },
1805
+ * "canCreateVersion": true
1806
+ * }
1807
+ * }
1808
+ */
1809
+ this . getBacklogForRapidView = function ( rapidViewId , callback ) {
1810
+ var options = {
1811
+ rejectUnauthorized : this . strictSSL ,
1812
+ uri : this . makeUri ( '/xboard/plan/backlog/data?rapidViewId=' + rapidViewId , 'rest/greenhopper/' ) ,
1813
+ method : 'GET' ,
1814
+ json : true
1815
+ } ;
1816
+
1817
+ this . doRequest ( options , function ( error , response ) {
1818
+ if ( error ) {
1819
+ callback ( error , null ) ;
1820
+
1821
+ return ;
1822
+ }
1823
+
1824
+ if ( response . statusCode === 200 ) {
1825
+ callback ( null , response . body ) ;
1826
+
1827
+ return ;
1828
+ }
1829
+
1830
+ callback ( response . statusCode + ': Error while retrieving backlog' ) ;
1831
+ } ) ;
1832
+ } ;
1834
1833
1835
1834
} ) . call ( JiraApi . prototype ) ;
0 commit comments