Skip to content

Latest commit

 

History

History
294 lines (217 loc) · 9.6 KB

ProjectCategoriesApi.md

File metadata and controls

294 lines (217 loc) · 9.6 KB

ProjectCategoriesApi

All URIs are relative to https://your-domain.atlassian.com

Method HTTP request Description
createProjectCategory POST /rest/api/3/projectCategory Create project category
getAllProjectCategories GET /rest/api/3/projectCategory Get all project categories
getProjectCategoryById GET /rest/api/3/projectCategory/{id} Get project category by ID
removeProjectCategory DELETE /rest/api/3/projectCategory/{id} Delete project category
updateProjectCategory PUT /rest/api/3/projectCategory/{id} Update project category

createProjectCategory

ProjectCategory createProjectCategory(body)

Create project category

Creates a project category. Permissions required: Administer Jira global permission.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectCategoriesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectCategoriesApi apiInstance = new ProjectCategoriesApi();
ProjectCategory body = new ProjectCategory(); // ProjectCategory | 
try {
    ProjectCategory result = apiInstance.createProjectCategory(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectCategoriesApi#createProjectCategory");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body ProjectCategory

Return type

ProjectCategory

Authorization

OAuth2basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getAllProjectCategories

List<ProjectCategory> getAllProjectCategories()

Get all project categories

Returns all project categories. Permissions required: Permission to access Jira.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectCategoriesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectCategoriesApi apiInstance = new ProjectCategoriesApi();
try {
    List<ProjectCategory> result = apiInstance.getAllProjectCategories();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectCategoriesApi#getAllProjectCategories");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

List<ProjectCategory>

Authorization

OAuth2basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getProjectCategoryById

ProjectCategory getProjectCategoryById(id)

Get project category by ID

Returns a project category. Permissions required: Permission to access Jira.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectCategoriesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectCategoriesApi apiInstance = new ProjectCategoriesApi();
Long id = 789L; // Long | The ID of the project category.
try {
    ProjectCategory result = apiInstance.getProjectCategoryById(id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectCategoriesApi#getProjectCategoryById");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long The ID of the project category.

Return type

ProjectCategory

Authorization

OAuth2basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

removeProjectCategory

removeProjectCategory(id)

Delete project category

Deletes a project category. Permissions required: Administer Jira global permission.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectCategoriesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectCategoriesApi apiInstance = new ProjectCategoriesApi();
Long id = 789L; // Long | ID of the project category to delete.
try {
    apiInstance.removeProjectCategory(id);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectCategoriesApi#removeProjectCategory");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
id Long ID of the project category to delete.

Return type

null (empty response body)

Authorization

OAuth2basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

updateProjectCategory

UpdatedProjectCategory updateProjectCategory(body, id)

Update project category

Updates a project category. Permissions required: Administer Jira global permission.

Example

// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.ProjectCategoriesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");

ProjectCategoriesApi apiInstance = new ProjectCategoriesApi();
ProjectCategory body = new ProjectCategory(); // ProjectCategory | 
Long id = 789L; // Long | 
try {
    UpdatedProjectCategory result = apiInstance.updateProjectCategory(body, id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ProjectCategoriesApi#updateProjectCategory");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body ProjectCategory
id Long

Return type

UpdatedProjectCategory

Authorization

OAuth2basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json