YouTrack Standalone 2019.1 Help

Visibility Settings

To set visibility of an issue, a comment, or an attachment, you need to use visibility attribute of the respective entity. However, by default this attribute has a common ancestor type for the both actual limited and unlimited types of visibility. Because of this, to update the visibility of an entity, you must provide explicitly the actual $type of the visibility attribute that you need in the body of a POST request.

To limit visibility for an entity, you must specify "$type": "LimitedVisibility" and then permittedGroups and/or permittedUsers attributes. permittedGroups and permittedUsers attributes should contain collections of entity ID's for groups and users, respectively, that should be able to view the target entity.

For example, the following JSON limits visibility of an entity to a group and two particular users:

{ "visibility": { "$type": "LimitedVisibility", "permittedGroups":[{"id":"3-2"}], "permittedUsers":[{"id":"1-2"},{"id":"1-35"}] } }

To remove visibility restrictions, you must specify "$type": "UnlimitedVisibility". For example:

{ "visibility": { "$type": "UnlimitedVisibility" } }

Restrict Visibility Sample

This sample request restricts visibility for an issue comment to a user group:

Sample request:

curl -X POST \ ',author%28login,name,id%29,deleted,text,updated,visibility%28permittedGroups%28name,id%29,permittedUsers%28id,name,login%29%29' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer perm:cm9vdA==.QWRtaW4gUmVzdCBBUEkgRG9jcw==.OcsxZrnZnBZhyWaGE0Uz1OiA5bRVNt' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "visibility": { "$type": "LimitedVisibility", "permittedGroups":[{"id":"3-2"}] } }'

Sample response body:

{ "deleted": false, "author": { "login": "john.doe", "name": "John Doe", "id": "1-2", "$type": "User" }, "visibility": { "permittedUsers": [], "permittedGroups": [ { "name": "Sample Project Team", "id": "3-2", "$type": "UserGroup" } ], "$type": "LimitedVisibility" }, "text": "okay, let's do it, @jane.doe. And check that - I am updating this using REST API!", "updated": 1534175928566, "id": "4-2", "$type": "IssueComment" }
Last modified: 12 April 2019