Add a group to Service desk Customer role in a team-managed JSM project

 

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

   

Summary

Learn how to add a group to Service Desk customer role in a team-managed JSM project. 

We have a feature request to improve this:

Diagnosis

To add a customer in a team-managed JSM project with restricted customer permission: "Customers added to this service project only by agents and admins", you need to add them from the Customers page directly: https://<YourSite>.atlassian.net/jira/servicedesk/projects/<PKEY>/customers

But there is no way to add a group directly to the Service Desk Customer role from the People section in Project settings, which already works in a company-managed project. Adding the group to the Viewer role will provide more than intended permissions if these users have a Jira license to access any JSW, JWM, or another JSM project. 

Cause

For each team-managed JSM project, there is a Service Desk customer role created, but it is hidden from the UI. There is no easy way from the UI to add groups directly to this role, while individual users can be added to the role by adding them from the Customers page directly: https://<YourSite>.atlassian.net/jira/servicedesk/projects/<PKEY>/customers

Solution

We can use the below workaround to add a group directly to the customer role in a team-managed JSM project. Please note these steps are applicable for a restricted team-managed project i.e. with customer permission “Customers added to this service project only by agents and admins”. For an open team-managed project i.e. with customer permission "Anyone allowed on the customer access settings" there is no need to follow these steps because all the existing users on the site are added as customers by default. 

Here are the steps to add a Jira group to the Service Desk customer role associated with a team-managed JSM project::

  1. First, we need to figure out the projectroleid for the Service Desk customer role associated with the team-managed project since it is a hidden role.

    1. Add a test email address as a customer to the project from the Customers tab: jira/servicedesk/projects/ES/customers
      Make sure the user has an Atlassian account on the site and is not added to any other role in the specific project already. 

    2. When you do this, you will see the user will be added to the People section with a Role hyphen (-). This is because the role is hidden. 

    3. Now, open the developer console on your browser and try to load the People page again. In the network logs, search for the request containing the keywords "?operation=ProjectActorsQuery"
    4. Next, check the Response tab for the request and find the projectroleid in use by the user you added in step (1.a) 
      In the below example, you can see the test user I added is part of the role id 10175

      {"email":"XXXXXXX@gmail.com",........."displayName":"Test by Atlassian support","roles":[10175]}

      {"data":{"projectActors":{"actors":[{"email":"XXXXX@atlassian.com","avatarUrl":"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/AAID/5268d2f8-f11f-4466-944d-95a1d73b8a5f/48","active":true,"accountId":"AAID","roleTypeId":"AAID","type":"atlassian-user-role-actor","displayName":"Swati Kahol","roles":[10172],"__typename":"ProjectActor"},{"email":"XXXXXXX@gmail.com","avatarUrl":"https://secure.gravatar.com/avatar/cf2428259faed3a8212543eb04168cfb?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FTS-6.png","active":true,"accountId":"AAID","roleTypeId":"AAID","type":"atlassian-user-role-actor","displayName":"Test by Atlassian support","roles":[10175],"__typename":"ProjectActor"}],"isLastBatch":true,"__typename":"ProjectActorResponse"}}}

    5. From the Web UI, verify the projectroleid and you will see that this is a hidden Service desk customer role: https://<YOURSITE>.http://atlassian.net/secure/project/EditProjectRole!default.jspa?id=<projectroleid>

  2. Now that we have the projectroleid from the previous steps, we will proceed with adding the group to the same project role using the REST API Add actors to project role.

    1. First, get the GroupID of the group. Open the group from User management and from the URL copy the id that's visible after the keyword groups. In this example, the GroupID of the group is 4ac623e6-8bdc-4550-923b-264cbe4231e3

    2. Finally, use the REST API to add the GroupID to the projectroleid associated with this team-managed project.
      Endpoint: https://<YOURSITE>.atlassian.net/rest/api/2/project/<PKEY>/role/<projectroleid>
      Request method: POST
      Body

      {
        "groupId": [
          "<GroupID>"
        ]
      }

      You will receive a successful 200 response code once the group is added:

    3. Verify from the UI the group is now added to the hidden project role

    4. Also, verify from the Customers tab that the users part of this group will show up as Customers. Adding/removing users from the group will reflect on the customer page as well:

Last modified on Jan 23, 2025

Was this helpful?

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