Tech review

Style guide

Page status



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 criteria.


Configuration


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.

Providing a description will help you to identify the purpose of the custom field.



Parser expressions


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

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


In order to hide the field value from the defined set of users, the operator in must be replaced with the operator not in .



Make the field value visible only to users in project roles

isInRole(%{system.currentUser}, "role1, role2, role3") ? (my_expression) : null


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



Make the field value visible only to users in groups

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


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






Display format


Format type

Choose Date Time Picker





Add the field to the relevant screens.

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





 Related use cases




JWT feature

Field type

Date-time

Number

Text

Parser functions

isInRole()

isInGroup()

Label