How to Remove Members from Issue Security Levels in Jira

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.

Summary

This article provides a solution for removing members from issue security levels in Jira, which is not easily achievable through the user interface. We'll explore an API-based approach that allows for direct removal of actors from existing security levels without the need for creating new levels or modifying issues.

Environment

Jira

Diagnosis


Users are unable to directly remove actors or users from a security level within a security scheme using the Jira UI. See Configure issue security schemes

The current workaround involves creating a new security level, adding users (excluding the ones to be removed), and then deleting the existing security level, which can be time-consuming and affects issue update dates.


Cause


Jira's UI does not provide a direct method to remove users from an existing security level within a security scheme once they have been added. This necessitates the use of APIs to manage security levels more flexibly.

Solution

To remove members from an issue security level without affecting issues or creating new levels, follow these steps using Jira's REST API:

  1. Retrieve Issue Security Level Members:

    • Use the Get issue security level members by issue security scheme API endpoint to get the list of members associated with a specific issue security level.

    • API Endpoint: GET /rest/api/3/issuesecurityschemes/{issueSecuritySchemeId}/members?issueSecurityLevelId={issueSecurityLevelId}

    • Replace {issueSecuritySchemeId} with the ID of your issue security scheme and {levelId} with the ID of the specific security level 1.

    • Example:

      curl --request GET \
        --url 'https://your-domain.atlassian.net/rest/api/3/issuesecurityschemes/{issueSecuritySchemeId}/members?issueSecurityLevelId={levelId}' \
        --user 'email@example.com:<api_token>' \
        --header 'Accept: application/json'
    • Identify the member Id(s) of the user(s) you wish to remove from the response. Example

      {
          "maxResults": 50,
          "startAt": 0,
          "total": 40,
          "isLast": true,
          "values": [
              {
                  "id": 10171,
                  "issueSecurityLevelId": 10001,
                  "holder": {
                      "type": "user",
                      "parameter": "6XXXX7b1894f007181XXX",
                      "value": "6XXXX7b1894f007181XXX",
                      "expand": "user"
                  }
              },
              {
                  "id": 10177,
                  "issueSecurityLevelId": 10001,
                  "holder": {
                      "type": "user",
                      "parameter": "70121:001XXX68-XXX-4433-XXX-606b28XXXXa",
                      "value": "70121:001XXX68-XXX-4433-XXX-606b28XXXXa",
                      "expand": "user"
                  }
              }
          ]
      }
  2. Remove the Member
  • Use the Remove member from issue security level API endpoint to delete the member from the issue security level.

  • API Endpoint: DELETE /rest/api/3/issuesecurityschemes/{schemeId}/level/{levelId}/member/{memberId}

  • Replace {schemeId} with the issue security scheme ID, {levelId} with the security level ID, and {memberId} with the ID of the member you want to remove.

  • Example:

    curl --request DELETE \
      --url 'https://your-domain.atlassian.net/rest/api/3/issuesecurityschemes/{schemeId}/level/{levelId}/member/{memberId}' \
      --user 'email@example.com:<api_token>' \
      --header 'Accept: application/json'
  • A successful deletion will return a 204 No Content response.


Reference:


Last modified on Nov 7, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.