Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties
hiddentrue


Tech review

Status
colourGrey
titletodo

Style guide

Status
colourGrey
titleTODO

Page status

Status
colourGrey
titleTODO

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged



UI Text Box
sizemedium
typeinfo

Use case

Restrict the users who can see the value of a calculated field according to their usernames, project roles or groups.

A conditional operator will be used to display only the values returned by a custom expression if the current user meets a definite criteriaThis use case will only display a Calculated field depending the usernames, user roles or user groups that we specify in our expression.


Image ModifiedConfiguration

UI Steps


UI Step

Create a new Calculated Field (by JWT) custom field and name it appropriately. For the following example, we will use a Calculated date-time field.

UI Text Box
typetip

Providing a description will help you to identify what the purpose of the custom field does, but this step is optional.



UI Step

Parser

expression

Depending on the functionality you want, the parser expression may change:

Display the Calculated field only to certain

expressions

expand
UI Steps


UI Step

Make the field value visible only to a static set of users

Code Block
languagebash
linenumberstrue
%{system.currentUser} in ["username1", "username2", "username3"] ? (my_expression) : null


ui-
titlemore info...
ui-
text-box
typeinfo
If you want to change the expression to hide this Calculated field to those users, you would only have to change in for not not in
Display the Calculated field only to certain user more info...
title
In order to hide the field value from the defined set of users, the operator in must be replaced with the operator not in .



UI Step

Make the field value visible only to users in project roles

Code Block
languagebash
linenumberstrue
isInRole(%{system.currentUser}, "role1, role2, role3") ? (my_expression) : null
UI Expand


UI Text Box
typeinfo
If you want to change the expression to hide this Calculated field to those user roles, you would only have to change isInRole for !isInRole
Display the Calculated field only to certain users expand
In order to hide the field value from the users in the defined project role, the isInRole() parser function should be negated as in !isInRole(%{system.currentUser}, "role1, role2, role3").



UI Step

Make the field value visible only to users in groups

Code Block
languagebash
linenumberstrue
isInGroup(%{system.currentUser}, "group1, group2, group3") ? (my_expression) : null


ui-
titlemore info...
ui-
text-box
typeinfo
If you want to change the expression to hide this Calculated field to those user groups, you would only have to change isInGroup for !isInGroup
In order to hide the field value from the users in the defined group, the isInGroup() parser function should be negated as in !isInGroup(%{system.currentUser}, "group1, group2, group3")






UI Step

Display format

UI Steps


UI Step

Format type

Choose Date Time Picker





ui-step
UI Step

Add the field to the relevant view screens.

UI Text Box
typenote

Remember: All calculated fields are read-only and cannot be manually updated.

Check the results

Once configured and added to an issue screen (e.g. an epic), the result will look like this:

Image Removed





Image Modified Related use cases

Page properties report
headingsField type, JWT feature, Label
sortByTitle
cqllabel = "calculated-field" and space = "JWTSDC" and ancestor = "27068727"


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue


Page properties
hiddentrue


JWT feature

Field type

Date-time

Number

Text

Parser functions

isInRole()

isInGroup()Operators

Label