Skip to content

Latest commit

 

History

History
424 lines (316 loc) · 14.9 KB

ScreensApi.md

File metadata and controls

424 lines (316 loc) · 14.9 KB

ScreensApi

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

Method HTTP request Description
addFieldToDefaultScreen POST /rest/api/3/screens/addToDefault/{fieldId} Add field to default screen
createScreen POST /rest/api/3/screens Create screen
deleteScreen DELETE /rest/api/3/screens/{screenId} Delete screen
getAvailableScreenFields GET /rest/api/3/screens/{screenId}/availableFields Get available screen fields
getScreens GET /rest/api/3/screens Get screens
getScreensForField GET /rest/api/3/field/{fieldId}/screens Get screens for a field
updateScreen PUT /rest/api/3/screens/{screenId} Update screen

addFieldToDefaultScreen

Object addFieldToDefaultScreen(fieldId)

Add field to default screen

Adds a field to the default tab of the default screen. 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.ScreensApi;

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

ScreensApi apiInstance = new ScreensApi();
String fieldId = "fieldId_example"; // String | The ID of the field.
try {
    Object result = apiInstance.addFieldToDefaultScreen(fieldId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#addFieldToDefaultScreen");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
fieldId String The ID of the field.

Return type

Object

Authorization

OAuth2basicAuth

HTTP request headers

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

createScreen

Screen createScreen(body)

Create screen

Creates a screen with a default field tab. 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.ScreensApi;

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

ScreensApi apiInstance = new ScreensApi();
ScreenDetails body = new ScreenDetails(); // ScreenDetails | 
try {
    Screen result = apiInstance.createScreen(body);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#createScreen");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body ScreenDetails

Return type

Screen

Authorization

OAuth2basicAuth

HTTP request headers

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

deleteScreen

deleteScreen(screenId)

Delete screen

Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. Only screens used in classic projects can be deleted.

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

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

ScreensApi apiInstance = new ScreensApi();
Long screenId = 789L; // Long | The ID of the screen.
try {
    apiInstance.deleteScreen(screenId);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#deleteScreen");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
screenId Long The ID of the screen.

Return type

null (empty response body)

Authorization

OAuth2basicAuth

HTTP request headers

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

getAvailableScreenFields

List<ScreenableField> getAvailableScreenFields(screenId)

Get available screen fields

Returns the fields that can be added to a tab on a screen. 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.ScreensApi;

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

ScreensApi apiInstance = new ScreensApi();
Long screenId = 789L; // Long | The ID of the screen.
try {
    List<ScreenableField> result = apiInstance.getAvailableScreenFields(screenId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#getAvailableScreenFields");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
screenId Long The ID of the screen.

Return type

List<ScreenableField>

Authorization

OAuth2basicAuth

HTTP request headers

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

getScreens

PageBeanScreen getScreens(startAt, maxResults, id)

Get screens

Returns a paginated list of all screens or those specified by one or more screen IDs. 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.ScreensApi;

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

ScreensApi apiInstance = new ScreensApi();
Long startAt = 0L; // Long | The index of the first item to return in a page of results (page offset).
Integer maxResults = 100; // Integer | The maximum number of items to return per page.
List<Long> id = Arrays.asList(56L); // List<Long> | The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`.
try {
    PageBeanScreen result = apiInstance.getScreens(startAt, maxResults, id);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#getScreens");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
startAt Long The index of the first item to return in a page of results (page offset). [optional] [default to 0]
maxResults Integer The maximum number of items to return per page. [optional] [default to 100]
id List<Long> The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. [optional]

Return type

PageBeanScreen

Authorization

OAuth2basicAuth

HTTP request headers

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

getScreensForField

PageBeanScreenWithTab getScreensForField(fieldId, startAt, maxResults, expand)

Get screens for a field

Returns a paginated list of the screens a field is used in. 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.ScreensApi;

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

ScreensApi apiInstance = new ScreensApi();
String fieldId = "fieldId_example"; // String | The ID of the field to return screens for.
Long startAt = 0L; // Long | The index of the first item to return in a page of results (page offset).
Integer maxResults = 100; // Integer | The maximum number of items to return per page.
String expand = "expand_example"; // String | Use [expand](#expansion) to include additional information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs the field is used in.
try {
    PageBeanScreenWithTab result = apiInstance.getScreensForField(fieldId, startAt, maxResults, expand);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#getScreensForField");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
fieldId String The ID of the field to return screens for.
startAt Long The index of the first item to return in a page of results (page offset). [optional] [default to 0]
maxResults Integer The maximum number of items to return per page. [optional] [default to 100]
expand String Use expand to include additional information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs the field is used in. [optional]

Return type

PageBeanScreenWithTab

Authorization

OAuth2basicAuth

HTTP request headers

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

updateScreen

Screen updateScreen(body, screenId)

Update screen

Updates a screen. Only screens used in classic projects can be updated. 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.ScreensApi;

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

ScreensApi apiInstance = new ScreensApi();
UpdateScreenDetails body = new UpdateScreenDetails(); // UpdateScreenDetails | 
Long screenId = 789L; // Long | The ID of the screen.
try {
    Screen result = apiInstance.updateScreen(body, screenId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ScreensApi#updateScreen");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
body UpdateScreenDetails
screenId Long The ID of the screen.

Return type

Screen

Authorization

OAuth2basicAuth

HTTP request headers

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