addSharePermission
Add share permission
Details
- Method:
POST - Path:
/rest/api/3/filter/{id}/permission - Operation ID:
addSharePermission
Parameters
{
"id": {
"description": "The ID of the filter.",
"required": true,
"location": "path",
"type": "integer",
"format": "int64"
},
"accountId": {
"description": "The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user.",
"required": false,
"location": "body",
"type": "string"
},
"groupId": {
"description": "The ID of the group, which uniquely identifies the group across all Atlassian products.For example, *952d12c3-5b5b-4d04-bb32-44d383afc4b2*. Cannot be provided with `groupname`.",
"required": false,
"location": "body",
"type": "string"
},
"groupname": {
"description": "The name of the group to share the filter with. Set `type` to `group`. Please note that the name of a group is mutable, to reliably identify a group use `groupId`.",
"required": false,
"location": "body",
"type": "string"
},
"projectId": {
"description": "The ID of the project to share the filter with. Set `type` to `project`.",
"required": false,
"location": "body",
"type": "string"
},
"projectRoleId": {
"description": "The ID of the project role to share the filter with. Set `type` to `projectRole` and the `projectId` for the project that the role is in.",
"required": false,
"location": "body",
"type": "string"
},
"rights": {
"description": "The rights for the share permission.",
"required": false,
"location": "body",
"type": "integer"
},
"type": {
"description": "The type of the share permission.Specify the type as follows:\n\n * `user` Share with a user.\n * `group` Share with a group. Specify `groupname` as well.\n * `project` Share with a project. Specify `projectId` as well.\n * `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well.\n * `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set.\n * `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set.",
"required": true,
"location": "body",
"type": "string",
"enum": [
"user",
"project",
"group",
"projectRole",
"global",
"authenticated"
]
}
}Response Schema
{
"items": {
"additionalProperties": false,
"description": "Details of a share permission for the filter.",
"properties": {
"group": {
"allOf": [
{
"$ref": "#/components/schemas/GroupName"
}
],
"description": "The group that the filter is shared with. For a request, specify the `groupId` or `name` property for the group. As a group's name can change, use of `groupId` is recommended."
},
"id": {
"description": "The unique identifier of the share permission.",
"format": "int64",
"readOnly": true,
"type": "integer"
},
"project": {
"allOf": [
{
"$ref": "#/components/schemas/Project"
}
],
"description": "The project that the filter is shared with. This is similar to the project object returned by [Get project](#api-rest-api-3-project-projectIdOrKey-get) but it contains a subset of the properties, which are: `self`, `id`, `key`, `assigneeType`, `name`, `roles`, `avatarUrls`, `projectType`, `simplified`. \nFor a request, specify the `id` for the project."
},
"role": {
"allOf": [
{
"$ref": "#/components/schemas/ProjectRole"
}
],
"description": "The project role that the filter is shared with. \nFor a request, specify the `id` for the role. You must also specify the `project` object and `id` for the project that the role is in."
},
"type": {
"description": "The type of share permission:\n\n * `user` Shared with a user.\n * `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well.\n * `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well.\n * `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in requests, where it needs to be specify with `projectId` and `projectRoleId`.\n * `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified.\n * `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as the `type`.\n * `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request.",
"enum": [
"user",
"group",
"project",
"projectRole",
"global",
"loggedin",
"authenticated",
"project-unknown"
],
"type": "string"
},
"user": {
"allOf": [
{
"$ref": "#/components/schemas/UserBean"
}
],
"description": "The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user."
}
},
"required": [
"type"
],
"type": "object"
},
"type": "array"
}Usage
from ocp_agent import OCPAgent
agent = OCPAgent()
await agent.register_api('jira')
# Call this tool
result = await agent.call_tool('addSharePermission', {
# Add required parameters here
})