jira.js
    Preparing search index...

    Function addSharePermission

    • Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the public) it will overwrite all share permissions for the filter.

      Be aware that this operation uses different objects for updating share permissions compared to Update filter.

      Permissions required: Share dashboards and filters global permission and the user must own the filter.

      Parameters

      • client: Client
      • parameters: {
            accountId?: string;
            groupId?: string;
            groupname?: string;
            id: number;
            projectId?: string;
            projectRoleId?: string;
            rights?: number;
            type:
                | "global"
                | "user"
                | "group"
                | string & {}
                | "project"
                | "projectRole"
                | "authenticated";
        }
        • OptionalaccountId?: string

          The user account ID that the filter is shared with. For a request, specify the accountId property for the user.

        • OptionalgroupId?: string

          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.

        • Optionalgroupname?: string

          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.

        • id: number

          The ID of the filter.

        • OptionalprojectId?: string

          The ID of the project to share the filter with. Set type to project.

        • OptionalprojectRoleId?: string

          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.

        • Optionalrights?: number

          The rights for the share permission.

        • type:
              | "global"
              | "user"
              | "group"
              | string & {}
              | "project"
              | "projectRole"
              | "authenticated"

          The type of the share permission.Specify the type as follows:

          • user Share with a user.
          • group Share with a group. Specify groupname as well.
          • project Share with a project. Specify projectId as well.
          • projectRole Share with a project role in a project. Specify projectId and projectRoleId as well.
          • 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.
          • 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.
      • Optionaloptions: RequestOptions

      Returns Promise<
          {
              group?: {
                  groupId?: string
                  | null;
                  name?: string;
                  self?: string;
                  [key: string]: unknown;
              };
              id?: number;
              project?: {
                  archived?: boolean;
                  archivedBy?: {
                      accountId?: string;
                      accountType?: "unknown"
                      | string & {}
                      | "atlassian"
                      | "app"
                      | "customer";
                      active?: boolean;
                      applicationRoles?: {
                          callback?: { [key: ...]: ... };
                          items?: (...)[];
                          "max-results"?: number;
                          pagingCallback?: { [key: ...]: ... };
                          size?: number;
                          [key: string]: unknown;
                      };
                      appType?: string;
                      avatarUrls?: {
                          "16x16"?: string;
                          "24x24"?: string;
                          "32x32"?: string;
                          "48x48"?: string;
                          [key: string]: unknown;
                      };
                      displayName?: string;
                      emailAddress?: string;
                      expand?: string;
                      groups?: {
                          callback?: { [key: ...]: ... };
                          items?: (...)[];
                          "max-results"?: number;
                          pagingCallback?: { [key: ...]: ... };
                          size?: number;
                          [key: string]: unknown;
                      };
                      guest?: boolean;
                      locale?: string;
                      self?: string;
                      timeZone?: string;
                      [key: string]: unknown;
                  };
                  archivedDate?: Date;
                  assigneeType?: string & {}
                  | "PROJECT_LEAD"
                  | "UNASSIGNED";
                  avatarUrls?: {
                      "16x16"?: string;
                      "24x24"?: string;
                      "32x32"?: string;
                      "48x48"?: string;
                      [key: string]: unknown;
                  };
                  components?: {
                      ari?: string;
                      assignee?: {
                          accountId?: (...)
                          | (...);
                          accountType?: (...) | (...) | (...) | (...) | (...) | (...);
                          active?: (...) | (...) | (...);
                          applicationRoles?: (...) | (...);
                          appType?: (...) | (...);
                          avatarUrls?: (...) | (...);
                          displayName?: (...) | (...);
                          emailAddress?: (...) | (...);
                          expand?: (...) | (...);
                          groups?: (...) | (...);
                          guest?: (...) | (...) | (...);
                          locale?: (...) | (...);
                          self?: (...) | (...);
                          timeZone?: (...) | (...);
                          [key: string]: unknown;
                      };
                      assigneeType?: | string & {}
                      | "PROJECT_DEFAULT"
                      | "COMPONENT_LEAD"
                      | "PROJECT_LEAD"
                      | "UNASSIGNED";
                      description?: string;
                      id?: string;
                      isAssigneeTypeValid?: boolean;
                      lead?: {
                          accountId?: (...)
                          | (...);
                          accountType?: (...) | (...) | (...) | (...) | (...) | (...);
                          active?: (...) | (...) | (...);
                          applicationRoles?: (...) | (...);
                          appType?: (...) | (...);
                          avatarUrls?: (...) | (...);
                          displayName?: (...) | (...);
                          emailAddress?: (...) | (...);
                          expand?: (...) | (...);
                          groups?: (...) | (...);
                          guest?: (...) | (...) | (...);
                          locale?: (...) | (...);
                          self?: (...) | (...);
                          timeZone?: (...) | (...);
                          [key: string]: unknown;
                      };
                      leadAccountId?: string;
                      metadata?: Record<string, any>;
                      name?: string;
                      project?: string;
                      projectId?: number;
                      realAssignee?: {
                          accountId?: (...) | (...);
                          accountType?: (...) | (...) | (...) | (...) | (...) | (...);
                          active?: (...) | (...) | (...);
                          applicationRoles?: (...) | (...);
                          appType?: (...) | (...);
                          avatarUrls?: (...) | (...);
                          displayName?: (...) | (...);
                          emailAddress?: (...) | (...);
                          expand?: (...) | (...);
                          groups?: (...) | (...);
                          guest?: (...) | (...) | (...);
                          locale?: (...) | (...);
                          self?: (...) | (...);
                          timeZone?: (...) | (...);
                          [key: string]: unknown;
                      };
                      realAssigneeType?: | string & {}
                      | "PROJECT_DEFAULT"
                      | "COMPONENT_LEAD"
                      | "PROJECT_LEAD"
                      | "UNASSIGNED";
                      self?: string;
                      [key: string]: unknown;
                  }[];
                  deleted?: boolean;
                  deletedBy?: {
                      accountId?: string;
                      accountType?: "unknown"
                      | string & {}
                      | "atlassian"
                      | "app"
                      | "customer";
                      active?: boolean;
                      applicationRoles?: {
                          callback?: { [key: ...]: ... };
                          items?: (...)[];
                          "max-results"?: number;
                          pagingCallback?: { [key: ...]: ... };
                          size?: number;
                          [key: string]: unknown;
                      };
                      appType?: string;
                      avatarUrls?: {
                          "16x16"?: string;
                          "24x24"?: string;
                          "32x32"?: string;
                          "48x48"?: string;
                          [key: string]: unknown;
                      };
                      displayName?: string;
                      emailAddress?: string;
                      expand?: string;
                      groups?: {
                          callback?: { [key: ...]: ... };
                          items?: (...)[];
                          "max-results"?: number;
                          pagingCallback?: { [key: ...]: ... };
                          size?: number;
                          [key: string]: unknown;
                      };
                      guest?: boolean;
                      locale?: string;
                      self?: string;
                      timeZone?: string;
                      [key: string]: unknown;
                  };
                  deletedDate?: Date;
                  description?: string;
                  email?: string;
                  entityId?: string;
                  expand?: string;
                  favourite?: boolean;
                  id?: string;
                  insight?: {
                      lastIssueUpdateTime?: Date;
                      totalIssueCount?: number;
                      [key: string]: unknown;
                  };
                  isPrivate?: boolean;
                  issueTypeHierarchy?: {
                      levels?: {
                          hierarchyLevelNumber?: (...)
                          | (...);
                          issueTypeIds?: (...) | (...);
                          level?: (...) | (...);
                          name?: (...) | (...);
                          [key: string]: unknown;
                      }[];
                      [key: string]: unknown;
                  };
                  issueTypes?: {
                      avatarId?: number;
                      description?: string;
                      entityId?: string;
                      hierarchyLevel?: number;
                      iconUrl?: string;
                      id?: string;
                      name?: string;
                      scope?: {
                          project?: (...)
                          | (...);
                          type?: (...) | (...) | (...) | (...);
                          [key: string]: unknown;
                      };
                      self?: string;
                      subtask?: boolean;
                      untranslatedName?: string;
                      [key: string]: unknown;
                  }[];
                  key?: string;
                  landingPageInfo?: {
                      attributes?: Record<string, any>;
                      boardId?: number;
                      boardName?: string;
                      projectKey?: string;
                      projectType?: string;
                      queueCategory?: string;
                      queueId?: number;
                      queueName?: string;
                      simpleBoard?: boolean;
                      simplified?: boolean;
                      url?: string;
                      [key: string]: unknown;
                  };
                  lead?: {
                      accountId?: string;
                      accountType?: "unknown"
                      | string & {}
                      | "atlassian"
                      | "app"
                      | "customer";
                      active?: boolean;
                      applicationRoles?: {
                          callback?: { [key: ...]: ... };
                          items?: (...)[];
                          "max-results"?: number;
                          pagingCallback?: { [key: ...]: ... };
                          size?: number;
                          [key: string]: unknown;
                      };
                      appType?: string;
                      avatarUrls?: {
                          "16x16"?: string;
                          "24x24"?: string;
                          "32x32"?: string;
                          "48x48"?: string;
                          [key: string]: unknown;
                      };
                      displayName?: string;
                      emailAddress?: string;
                      expand?: string;
                      groups?: {
                          callback?: { [key: ...]: ... };
                          items?: (...)[];
                          "max-results"?: number;
                          pagingCallback?: { [key: ...]: ... };
                          size?: number;
                          [key: string]: unknown;
                      };
                      guest?: boolean;
                      locale?: string;
                      self?: string;
                      timeZone?: string;
                      [key: string]: unknown;
                  };
                  name?: string;
                  permissions?: { canEdit?: boolean; [key: string]: unknown };
                  projectCategory?: {
                      description?: string;
                      id?: string;
                      name?: string;
                      self?: string;
                      [key: string]: unknown;
                  };
                  projectTypeKey?: | string & {}
                  | "software"
                  | "service_desk"
                  | "business"
                  | "product_discovery"
                  | "customer_service";
                  properties?: Record<string, any>;
                  retentionTillDate?: Date;
                  roles?: Record<string, any>;
                  self?: string;
                  simplified?: boolean;
                  style?: "classic" | string & {} | "next-gen";
                  url?: string;
                  uuid?: string;
                  versions?: {
                      approvers?: {
                          accountId?: ...;
                          declineReason?: ...;
                          description?: ...;
                          status?: ...;
                          [key: ...]: ...;
                      }[];
                      archived?: boolean;
                      description?: string;
                      driver?: string;
                      expand?: string;
                      id?: string;
                      issuesStatusForFixVersion?: {
                          done?: (...)
                          | (...);
                          inProgress?: (...) | (...);
                          toDo?: (...) | (...);
                          unmapped?: (...) | (...);
                          [key: string]: unknown;
                      };
                      moveUnfixedIssuesTo?: string;
                      name?: string;
                      operations?: {
                          href?: ...;
                          iconClass?: ...;
                          id?: ...;
                          label?: ...;
                          styleClass?: ...;
                          title?: ...;
                          weight?: ...;
                          [key: ...]: ...;
                      }[];
                      overdue?: boolean;
                      projectId?: number;
                      released?: boolean;
                      releaseDate?: string;
                      self?: string;
                      startDate?: string;
                      userReleaseDate?: string;
                      userStartDate?: string;
                      [key: string]: unknown;
                  }[];
                  [key: string]: unknown;
              };
              role?: {
                  actors?: {
                      actorGroup?: {
                          displayName?: (...)
                          | (...);
                          groupId?: (...) | (...);
                          name?: (...) | (...);
                          [key: string]: unknown;
                      };
                      actorUser?: { accountId?: (...)
                      | (...); [key: string]: unknown };
                      avatarUrl?: string;
                      displayName?: string;
                      id?: number;
                      type?:
                          | string & {}
                          | "atlassian-group-role-actor"
                          | "atlassian-user-role-actor";
                      [key: string]: unknown;
                  }[];
                  admin?: boolean;
                  currentUserRole?: boolean;
                  default?: boolean;
                  description?: string;
                  id?: number;
                  name?: string;
                  roleConfigurable?: boolean;
                  scope?: {
                      project?: {
                          avatarUrls?: {
                              "16x16"?: ...;
                              "24x24"?: ...;
                              "32x32"?: ...;
                              "48x48"?: ...;
                              [key: ...]: ...;
                          };
                          id?: string;
                          key?: string;
                          name?: string;
                          projectCategory?: {
                              description?: ...;
                              id?: ...;
                              name?: ...;
                              self?: ...;
                              [key: ...]: ...;
                          };
                          projectTypeKey?: | (...) & (...)
                          | "software"
                          | "service_desk"
                          | "business"
                          | "product_discovery"
                          | "customer_service";
                          self?: string;
                          simplified?: boolean;
                          [key: string]: unknown;
                      };
                      type?: string & {}
                      | "PROJECT"
                      | "TEMPLATE";
                      [key: string]: unknown;
                  };
                  self?: string;
                  translatedName?: string;
                  [key: string]: unknown;
              };
              type: | "global"
              | "user"
              | "group"
              | string & {}
              | "project"
              | "projectRole"
              | "loggedin"
              | "authenticated"
              | "project-unknown";
              user?: {
                  accountId?: string;
                  active?: boolean;
                  avatarUrls?: {
                      "16x16"?: string;
                      "24x24"?: string;
                      "32x32"?: string;
                      "48x48"?: string;
                      [key: string]: unknown;
                  };
                  displayName?: string;
                  self?: string;
                  [key: string]: unknown;
              };
              [key: string]: unknown;
          }[],
      >