UNPKG

synergia-jira-connector

Version:

Easy to use NodeJS wrapper for the Jira REST API.

1,877 lines (978 loc) 44.9 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: VersionClient</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: VersionClient</h1> <section> <header> <h2> VersionClient </h2> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="VersionClient"><span class="type-signature"></span>new VersionClient<span class="signature">(jiraClient)</span><span class="type-signature"></span></h4> <div class="description"> <p>Used to access Jira REST endpoints in '/rest/api/2/version'</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>jiraClient</code></td> <td class="type"> <span class="param-type"><a href="JiraClient.html">JiraClient</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line5">line 5</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="createRemoteLink"><span class="type-signature"></span>createRemoteLink<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Create a remote version link via POST. The link's global id will be taken from the JSON payload if provided; otherwise, it will be generated.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> </td> <td class="description last"><p>The version for which to retrieve unresolved issues.</p> </td> </tr> <tr> <td class="name"><code>remoteLink</code></td> <td class="type"> </td> <td class="description last"><p>See <a href="https://docs.atlassian.com/jira/REST/latest/#d2e3753">https://docs.atlassian.com/jira/REST/latest/#d2e3753</a> </p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the remote link has been created.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line124">line 124</a> </li> </ul> </dd> </dl> <h4 class="name" id="createVersion"><span class="type-signature"></span>createVersion<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Creates a version</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>The request options sent to Jira.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>See <a href="https://docs.atlassian.com/jira/REST/latest/#d2e3549">https://docs.atlassian.com/jira/REST/latest/#d2e3549</a> </p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the version has been created.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line13">line 13</a> </li> </ul> </dd> </dl> <h4 class="name" id="createVersion"><span class="type-signature"></span>createVersion<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Modify an existing version; any omitted fields will be ignored.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>The request options sent to Jira.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The id of the version to edit.</p></td> </tr> <tr> <td class="name"><code>version</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>See <a href="https://docs.atlassian.com/jira/REST/latest/#d2e3619">https://docs.atlassian.com/jira/REST/latest/#d2e3619</a> </p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the version has been modified.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line67">line 67</a> </li> </ul> </dd> </dl> <h4 class="name" id="deleteAllRemoteLinks"><span class="type-signature"></span>deleteAllRemoteLinks<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Delete all remote version links for a given version id.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">number</span> </td> <td class="description last"><p>The id of the version to delete.</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the version is deleted.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line184">line 184</a> </li> </ul> </dd> </dl> <h4 class="name" id="deleteRemoteLink"><span class="type-signature"></span>deleteRemoteLink<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Delete a remote version link.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> </td> <td class="description last"><p>The version id</p></td> </tr> <tr> <td class="name"><code>remoteLinkId</code></td> <td class="type"> </td> <td class="description last"><p>The global id of the remote link</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the link has been deleted.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line155">line 155</a> </li> </ul> </dd> </dl> <h4 class="name" id="deleteVersion"><span class="type-signature"></span>deleteVersion<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Delete a project version.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">number</span> </td> <td class="description last"><p>The id of the version to delete.</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the version is deleted.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line170">line 170</a> </li> </ul> </dd> </dl> <h4 class="name" id="getGlobalRemoteLink"><span class="type-signature"></span>getGlobalRemoteLink<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Returns the remote version links for a given global id.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>globalId</code></td> <td class="type"> </td> <td class="description last"><p>The global id of the remote resource that is linked to the versions</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the remote link is returned.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line198">line 198</a> </li> </ul> </dd> </dl> <h4 class="name" id="getRelatedIssueCounts"><span class="type-signature"></span>getRelatedIssueCounts<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Get a bean containing the number of fixed in and affected issues for the given version.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> </td> <td class="description last"><p>The version for which to retrieve related issues.</p> </td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the count has been retrieved.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line82">line 82</a> </li> </ul> </dd> </dl> <h4 class="name" id="getRemoteLinks"><span class="type-signature"></span>getRemoteLinks<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Get the remote version links associated with the given version id.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> </td> <td class="description last"><p>The version for which to retrieve remote links.</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the links have been retrieved.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line110">line 110</a> </li> </ul> </dd> </dl> <h4 class="name" id="getRemoteLinks"><span class="type-signature"></span>getRemoteLinks<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Get a REST sub-resource representing a remote version link.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> </td> <td class="description last"><p>The version for which to retrieve the remote link</p> </td> </tr> <tr> <td class="name"><code>remoteLinkId</code></td> <td class="type"> </td> <td class="description last"><p>The global id of the remote link</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the link has been retrieved.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line140">line 140</a> </li> </ul> </dd> </dl> <h4 class="name" id="getUnresolvedIssueCount"><span class="type-signature"></span>getUnresolvedIssueCount<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Get the number of unresolved issues for the given version</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> </td> <td class="description last"><p>The version for which to retrieve unresolved issues.</p> </td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the count has been retrieved.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line96">line 96</a> </li> </ul> </dd> </dl> <h4 class="name" id="getVersion"><span class="type-signature"></span>getVersion<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Get a project version.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">number</span> </td> <td class="description last"><p>The id of the version to retrieve.</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the version is retrieved.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line53">line 53</a> </li> </ul> </dd> </dl> <h4 class="name" id="moveVersion"><span class="type-signature"></span>moveVersion<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Modify a version's sequence within a project. The move version bean has 2 alternative field value pairs (opts.position or opts.after). One and only one of these two must be provided.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>The request options sent to the Jira API.</p> <h6>Properties</h6> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>versionId</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="description last"><p>The id of the version to move.</p></td> </tr> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>An absolute position, which may have a value of 'First', 'Last', 'Earlier' or 'Later'. Must be provided if opts.after is missing.</p></td> </tr> <tr> <td class="name"><code>after</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>A version to place this version after. The value should be the self link of another version. Must be provided if opts.position is missing</p></td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the version has been moved.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="api_version.js.html">api/version.js</a>, <a href="api_version.js.html#line34">line 34</a> </li> </ul> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2> <h3>Classes</h3> <ul> <li><a href="ApplicationPropertiesClient.html">ApplicationPropertiesClient</a></li> <li><a href="AttachmentClient.html">AttachmentClient</a></li> <li><a href="AuditingClient.html">AuditingClient</a></li> <li><a href="AvatarClient.html">AvatarClient</a></li> <li><a href="CommentClient.html">CommentClient</a></li> <li><a href="ComponentClient.html">ComponentClient</a></li> <li><a href="CustomFieldOptionClient.html">CustomFieldOptionClient</a></li> <li><a href="DashboardClient.html">DashboardClient</a></li> <li><a href="FieldClient.html">FieldClient</a></li> <li><a href="FilterClient.html">FilterClient</a></li> <li><a href="GroupClient.html">GroupClient</a></li> <li><a href="GroupsClient.html">GroupsClient</a></li> <li><a href="GroupUserPickerClient.html">GroupUserPickerClient</a></li> <li><a href="IssueLinkClient.html">IssueLinkClient</a></li> <li><a href="IssueLinkTypeClient.html">IssueLinkTypeClient</a></li> <li><a href="IssueTypeClient.html">IssueTypeClient</a></li> <li><a href="JiraClient.html">JiraClient</a></li> <li><a href="JqlClient.html">JqlClient</a></li> <li><a href="LicenseRoleClient.html">LicenseRoleClient</a></li> <li><a href="LicenseValidatorClient.html">LicenseValidatorClient</a></li> <li><a href="MyPermissionsClient.html">MyPermissionsClient</a></li> <li><a href="MyPreferencesClient.html">MyPreferencesClient</a></li> <li><a href="MyselfClient.html">MyselfClient</a></li> <li><a href="PasswordClient.html">PasswordClient</a></li> <li><a href="PriorityClient.html">PriorityClient</a></li> <li><a href="ProjectCategoryClient.html">ProjectCategoryClient</a></li> <li><a href="ProjectClient.html">ProjectClient</a></li> <li><a href="ProjectValidateClient.html">ProjectValidateClient</a></li> <li><a href="ReindexClient.html">ReindexClient</a></li> <li><a href="ResolutionClient.html">ResolutionClient</a></li> <li><a href="ScreensClient.html">ScreensClient</a></li> <li><a href="SearchClient.html">SearchClient</a></li> <li><a href="SecurityLevelClient.html">SecurityLevelClient</a></li> <li><a href="ServerInfoClient.html">ServerInfoClient</a></li> <li><a href="SettingsClient.html">SettingsClient</a></li> <li><a href="StatusCategoryClient.html">StatusCategoryClient</a></li> <li><a href="StatusClient.html">StatusClient</a></li> <li><a href="UserClient.html">UserClient</a></li> <li><a href="VersionClient.html">VersionClient</a></li> <li><a href="WorkflowClient.html">WorkflowClient</a></li> <li><a href="WorkflowSchemeClient.html">WorkflowSchemeClient</a></li> </ul> <h3>Namespaces</h3> <ul> <li><a href="OauthUtil.html">OauthUtil</a></li> </ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha13</a> on Tue Oct 27 2015 13:43:14 GMT-0500 (CDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"></script> </body> </html>