It is possible to restrict an a Jira worklog attribute for only specific types of issues, projects or users. You can do this by using a JSONata expression. Although JSONata can query a JSON document and return arrays, strings, object, for the scope of applicability checks, you need to return a Boolean value. If the returned value is true, attribute will be displayed, otherwise it will not be displayed.
...
Code Block |
---|
$boolean($filter(user.applicationRoles.items.key, function($v) {$v = 'jira-servicedesk'})) |
...
Code Block |
---|
$boolean($filter(use.groups.items.name, function($v) {$v = 'jira-administrators'})) |
Check Current Issue Type
The following expression only allows Jira worklog attribute if issue type is either Story or Epic.
Code Block |
---|
issue.fields.issuetype.name in ["Story", "Epic"] |