Skip to content

Latest commit

 

History

History
285 lines (210 loc) · 10.6 KB

TimeTrackingApi.md

File metadata and controls

285 lines (210 loc) · 10.6 KB

TimeTrackingApi

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

Method HTTP request Description
getAvailableTimeTrackingImplementations GET /rest/api/3/configuration/timetracking/list Get all time tracking providers
getSelectedTimeTrackingImplementation GET /rest/api/3/configuration/timetracking Get selected time tracking provider
getSharedTimeTrackingConfiguration GET /rest/api/3/configuration/timetracking/options Get time tracking settings
selectTimeTrackingImplementation PUT /rest/api/3/configuration/timetracking Select time tracking provider
setSharedTimeTrackingConfiguration PUT /rest/api/3/configuration/timetracking/options Set time tracking settings

getAvailableTimeTrackingImplementations

List<TimeTrackingProvider> getAvailableTimeTrackingImplementations()

Get all time tracking providers

Returns all time tracking providers. By default, Jira only has one time tracking provider: JIRA provided time tracking. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more information on time tracking providers, see the documentation for the Time Tracking Provider module. 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.TimeTrackingApi;

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

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

Parameters

This endpoint does not need any parameter.

Return type

List<TimeTrackingProvider>

Authorization

OAuth2basicAuth

HTTP request headers

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

getSelectedTimeTrackingImplementation

TimeTrackingProvider getSelectedTimeTrackingImplementation()

Get selected time tracking provider

Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a successful but empty response is returned. 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.TimeTrackingApi;

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

TimeTrackingApi apiInstance = new TimeTrackingApi();
try {
    TimeTrackingProvider result = apiInstance.getSelectedTimeTrackingImplementation();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TimeTrackingApi#getSelectedTimeTrackingImplementation");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

TimeTrackingProvider

Authorization

OAuth2basicAuth

HTTP request headers

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

getSharedTimeTrackingConfiguration

TimeTrackingConfiguration getSharedTimeTrackingConfiguration()

Get time tracking settings

Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. For more information, see Configuring time tracking. 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.TimeTrackingApi;

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

TimeTrackingApi apiInstance = new TimeTrackingApi();
try {
    TimeTrackingConfiguration result = apiInstance.getSharedTimeTrackingConfiguration();
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TimeTrackingApi#getSharedTimeTrackingConfiguration");
    e.printStackTrace();
}

Parameters

This endpoint does not need any parameter.

Return type

TimeTrackingConfiguration

Authorization

OAuth2basicAuth

HTTP request headers

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

selectTimeTrackingImplementation

Object selectTimeTrackingImplementation(body)

Select time tracking provider

Selects a time tracking provider. 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.TimeTrackingApi;

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

TimeTrackingApi apiInstance = new TimeTrackingApi();
TimeTrackingProvider body = new TimeTrackingProvider(); // TimeTrackingProvider | 
try {
    Object result = apiInstance.selectTimeTrackingImplementation(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling TimeTrackingApi#selectTimeTrackingImplementation");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body TimeTrackingProvider

Return type

Object

Authorization

OAuth2basicAuth

HTTP request headers

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

setSharedTimeTrackingConfiguration

TimeTrackingConfiguration setSharedTimeTrackingConfiguration(body)

Set time tracking settings

Sets the time tracking settings. 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.TimeTrackingApi;

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

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

Parameters

Name Type Description Notes
body TimeTrackingConfiguration

Return type

TimeTrackingConfiguration

Authorization

OAuth2basicAuth

HTTP request headers

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