This resource represents information about the current user, such as basic details, group membership, application roles, preferences, and locale. Use it to get, create, update, and delete (restore default) values of the user's preferences and locale.
Returns the value of a preference of the current user.
Note that these keys are deprecated:
These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not have any impact on Notification behaviour.
Use Update a user profile from the user management REST API to manage timezone and locale instead.
Permissions required: Permission to access Jira.
manage:jira-configuration
read:user-configuration:jira
Connect app scope required: ACT_AS_USER
string
RequiredReturned if the request is successful.
string
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/mypreferences?key={key}`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
"<string>"
Creates a preference for the user or updates a preference's value by sending a plain text string. For example, false
. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the following keys define system preferences that can be set or created:
html
.true
.false
.Note that these keys are deprecated:
These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary preferences, but it will not have any impact on Notification behaviour.
Use Update a user profile from the user management REST API to manage timezone and locale instead.
Permissions required: Permission to access Jira.
manage:jira-configuration
write:user-configuration:jira
Connect app scope required: ACT_AS_USER
string
RequiredThe value of the preference as a plain text string. The maximum length is 255 characters.
string
Returned if the request is successful.
any
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
var bodyData = `"<string>"`;
const response = await api.asUser().requestJira(route`/rest/api/3/mypreferences?key={key}`, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Deletes a preference of the user, which restores the default value of system defined settings.
Note that these keys are deprecated:
Use Update a user profile from the user management REST API to manage timezone and locale instead.
Permissions required: Permission to access Jira.
manage:jira-configuration
delete:user-configuration:jira
Connect app scope required: ACT_AS_USER
string
RequiredReturned if the request is successful.
1
2
3
4
5
6
7
8
9
10
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/mypreferences?key={key}`, {
method: 'DELETE'
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.text());
Returns the locale for the user.
If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, the browser locale detected by Jira is returned. Jira detects the browser locale using the Accept-Language header in the request. However, if this doesn't match a locale available Jira, the site default locale is returned.
This operation can be accessed anonymously.
Permissions required: None.
manage:jira-configuration
read:user-configuration:jira
Connect app scope required: ACT_AS_USER
This request has no parameters.
Returned if the request is successful.
Details of a locale.
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/mypreferences/locale`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
{
"locale": "en_US"
}
Deprecated, use Update a user profile from the user management REST API instead.
Sets the locale of the user. The locale must be one supported by the instance of Jira.
Permissions required: Permission to access Jira.
Connect apps cannot access this REST resource.
The locale defined in a LocaleBean.
string
Returned if the request is successful.
any
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/jira/platform/rest/v3/#authentication
import api, { route } from "@forge/api";
var bodyData = `{
"locale": "en_US"
}`;
const response = await api.requestJira(route`/rest/api/3/mypreferences/locale`, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: bodyData
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Deprecated, use Update a user profile from the user management REST API instead.
Deletes the locale of the user, which restores the default setting.
Permissions required: Permission to access Jira.
Connect apps cannot access this REST resource.
This request has no parameters.
Returned if the request is successful.
any
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/jira/platform/rest/v3/#authentication
import api, { route } from "@forge/api";
const response = await api.requestJira(route`/rest/api/3/mypreferences/locale`, {
method: 'DELETE',
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
Returns details for the current user.
Permissions required: Permission to access Jira.
read:jira-user
read:application-role:jira
, read:group:jira
, read:user:jira
, read:avatar:jira
Connect app scope required: READ
string
Returned if the request is successful.
A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:
displayName
provides an indication and other parameters have default values or are blank (for example, email is blank).accountId
returns unknown and all other parameters have fallback values.1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestJira(route`/rest/api/3/myself`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"accountId": "5b10a2844c20165700ede21g",
"accountType": "atlassian",
"active": true,
"applicationRoles": {
"items": [],
"size": 1
},
"avatarUrls": {
"16x16": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=16&s=16",
"24x24": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=24&s=24",
"32x32": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=32&s=32",
"48x48": "https://avatar-management--avatars.server-location.prod.public.atl-paas.net/initials/MK-5.png?size=48&s=48"
},
"displayName": "Mia Krystof",
"emailAddress": "mia@example.com",
"groups": {
"items": [],
"size": 3
},
"key": "",
"name": "",
"self": "https://your-domain.atlassian.net/rest/api/3/user?accountId=5b10a2844c20165700ede21g",
"timeZone": "Australia/Sydney"
}
Rate this page: