UNPKG

synergia-jira-connector

Version:

Easy to use NodeJS wrapper for the Jira REST API.

1,260 lines (675 loc) 30.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: ProjectClient</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: ProjectClient</h1> <section> <header> <h2> ProjectClient </h2> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="ProjectClient"><span class="type-signature"></span>new ProjectClient<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/project'</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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line5">line 5</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="addToRole"><span class="type-signature"></span>addToRole<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Add an actor to a project role.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</p></td> </tr> <tr> <td class="name"><code>roleId</code></td> <td class="type"> </td> <td class="description last"><p>The id of the role to retrieve.</p></td> </tr> <tr> <td class="name"><code>newRole</code></td> <td class="type"> </td> <td class="description last"><p>See <a href="https://docs.atlassian.com/jira/REST/latest/#d2e134">https://docs.atlassian.com/jira/REST/latest/#d2e134</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 roles 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line135">line 135</a> </li> </ul> </dd> </dl> <h4 class="name" id="getAllProjects"><span class="type-signature"></span>getAllProjects<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Returns all projects which are visible for the currently logged in user. If no user is logged in, it returns the list of projects that are visible when using anonymous access.</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>Ignored</p></td> </tr> <tr> <td class="name"><code>callback</code></td> <td class="type"> </td> <td class="description last"><p>Called when the projects 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line13">line 13</a> </li> </ul> </dd> </dl> <h4 class="name" id="getComponents"><span class="type-signature"></span>getComponents<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Contains a full representation of a the specified project's components.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</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 components are 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line48">line 48</a> </li> </ul> </dd> </dl> <h4 class="name" id="getProject"><span class="type-signature"></span>getProject<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Contains a full representation of a project in JSON format.</p> <p>All project keys associated with the project will only be returned if expand=projectKeys.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</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 project 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line32">line 32</a> </li> </ul> </dd> </dl> <h4 class="name" id="getRole"><span class="type-signature"></span>getRole<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Details on a given project role.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</p></td> </tr> <tr> <td class="name"><code>roleId</code></td> <td class="type"> </td> <td class="description last"><p>The id of the role 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 roles 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line104">line 104</a> </li> </ul> </dd> </dl> <h4 class="name" id="getRoles"><span class="type-signature"></span>getRoles<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Contains a list of roles in this project with links to full details.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</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 roles 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line90">line 90</a> </li> </ul> </dd> </dl> <h4 class="name" id="getStatuses"><span class="type-signature"></span>getStatuses<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Get all issue types with valid status values for a project</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</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 statuses 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line62">line 62</a> </li> </ul> </dd> </dl> <h4 class="name" id="getVersions"><span class="type-signature"></span>getVersions<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Contains a full representation of a the specified project's versions.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</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 versions 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line76">line 76</a> </li> </ul> </dd> </dl> <h4 class="name" id="updateRole"><span class="type-signature"></span>updateRole<span class="signature">(opts, callback)</span><span class="type-signature"></span></h4> <div class="description"> <p>Updates a project role to contain the sent actors.</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>projectIdOrKey</code></td> <td class="type"> </td> <td class="description last"><p>The project id or project key</p></td> </tr> <tr> <td class="name"><code>roleId</code></td> <td class="type"> </td> <td class="description last"><p>The id of the role to retrieve.</p></td> </tr> <tr> <td class="name"><code>newRole</code></td> <td class="type"> </td> <td class="description last"><p>See <a href="https://docs.atlassian.com/jira/REST/latest/#d2e108">https://docs.atlassian.com/jira/REST/latest/#d2e108</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 roles 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_project.js.html">api/project.js</a>, <a href="api_project.js.html#line119">line 119</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="IssueClient.html">IssueClient</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 Fri Oct 16 2015 13:33:16 GMT-0500 (CDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"></script> </body> </html>