public class

CurrentUserPreferencesResource

extends Object
java.lang.Object
   ↳ com.atlassian.jira.rest.v2.preference.CurrentUserPreferencesResource

Class Overview

Provide preferences of the currently logged in user.

Summary

Public Constructors
CurrentUserPreferencesResource(JiraAuthenticationContext jiraAuthenticationContext, UserPreferencesManager userPreferencesManager)
Public Methods
Response getPreference(String key)
Returns preference of the currently logged in user.
Response removePreference(String key)
Removes preference of the currently logged in user.
Response setPreference(String key, String value)
Sets preference of the currently logged in user.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CurrentUserPreferencesResource (JiraAuthenticationContext jiraAuthenticationContext, UserPreferencesManager userPreferencesManager)

Public Methods

public Response getPreference (String key)

Returns preference of the currently logged in user. Preference key must be provided as input parameter (key). The value is returned exactly as it is. If key parameter is not provided or wrong - status code 404. If value is found - status code 200.

Parameters
key - key of the preference to be returned.
Returns
  • response with value of one preference of currently logged in user.

public Response removePreference (String key)

Removes preference of the currently logged in user. Preference key must be provided as input parameters (key). If key parameter is not provided or wrong - status code 404. If preference is unset - status code 204.

Parameters
key - key of the preference to be removed.
Returns
  • empty response

public Response setPreference (String key, String value)

Sets preference of the currently logged in user. Preference key must be provided as input parameters (key). Value must be provided as post body. If key or value parameter is not provided - status code 404. If preference is set - status code 204.

Parameters
key - key of the preference to be set.
value - value of the preference to be set.
Returns
  • empty response