Skip to content

Latest commit

 

History

History
123 lines (90 loc) · 4.05 KB

TasksApi.md

File metadata and controls

123 lines (90 loc) · 4.05 KB

TasksApi

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

Method HTTP request Description
cancelTask POST /rest/api/3/task/{taskId}/cancel Cancel task
getTask GET /rest/api/3/task/{taskId} Get task

cancelTask

Object cancelTask(taskId)

Cancel task

Cancels a task. Permissions required: either of: * Administer Jira global permission. * Creator of the task.

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.TasksApi;

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");

TasksApi apiInstance = new TasksApi();
String taskId = "taskId_example"; // String | The ID of the task.
try {
    Object result = apiInstance.cancelTask(taskId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TasksApi#cancelTask");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
taskId String The ID of the task.

Return type

Object

Authorization

OAuth2basicAuth

HTTP request headers

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

getTask

TaskProgressBeanObject getTask(taskId)

Get task

Returns the status of a long-running asynchronous task. When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the operation that created the task for details. Task details are not permanently retained. As of September 2019, details are retained for 14 days although this period may change without notice. Permissions required: either of: * Administer Jira global permission. * Creator of the task.

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.TasksApi;

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");

TasksApi apiInstance = new TasksApi();
String taskId = "taskId_example"; // String | The ID of the task.
try {
    TaskProgressBeanObject result = apiInstance.getTask(taskId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TasksApi#getTask");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
taskId String The ID of the task.

Return type

TaskProgressBeanObject

Authorization

OAuth2basicAuth

HTTP request headers

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