Dependencies using the current user
It may be useful to display data related to the logged-in user. To do that, you can reference current user attributes in a Custom field query.
The $currentUser variable is available and exposes 5 attributes:
Type | Name | Description | Example |
---|---|---|---|
String | displayName | Returns a string which corresponds to the logged-in user display name | $currentUser.displayName |
String | emailAddress | Returns a string which corresponds to the logged-in user email address | $currentUser.emailAddress > "john.doe@elements-apps.com" |
String | accountId | Returns a unique identifier which corresponds to the logged-in user Atlassian account ID | $currentUser.accountId |
String | locale | Returns a string which corresponds to the logged-in user locale | $currentUser.locale |
String | timeZone | Returns a string which corresponds to the logged-in user timezone | $currentUser.timeZone |
If we go back to our previous example, we could highly simplify the process by only configuring one custom field, based on the logged-in user:
Model
Considering each car is linked to its owner in the data source, we can configure the following request:
SELECT model
FROM car_models
WHERE car_owner ='$currentUser.emailAddress'
Only cars from the logged-in user will be available as options of the custom field