Skip to end of metadata
Go to start of metadata

Cprime Apps has been rebranded as Anova Apps. Please note the only effect is the company name - all of our products’ names, logos, functionalities, support, etc. is exactly the same. The new location to our documentation space is https://anovaapps.atlassian.net.

The availability of the users personal data may be impacted by the recent changes by Atlassian in order to meet GDPR compliance. See the following for more information:


Availability

  • This routine is available starting with katl-commons 1.0.
  • This routine is available for Jira server and cloud deployment options.


Syntax for the server version

userHasAccessToComment(user, comment_id)

Syntax for the cloud version

userHasAccessToComment(issue, user, comment_id)


Description

Verifies if a comment is visible for an user.

Parameters for the server version

Parameter nameTypeRequiredDescription
userStringYesUsername or userkey of the user.
comment_idNumberYesId of the comment.

The look-up is first made after the userkey, then after the username.

Parameters for the cloud version

Parameter nameTypeRequiredDescription
issueStringYesThe issue key.
userStringYesThe account id of the user.
comment_idNumberYesId of the comment.

Return type

boolean (true/false)

A "true" return value means that the user can see the comment.

Example (server only)

 

userHasAccessToComment("admin","10000");

Returns "true" if the user "admin" can see the comment with id "10000" and "false" if the user cannot see the comment.

Example (cloud only)

 

userHasAccessToComment(key, "admin","10000");

Returns "true" if the user "admin" can see the comment with id "10000"  from the current issue and "false" if the user cannot see the comment.

See also