Create a Role
Starting October 11, 2024 (Zephyr Enterprise 8.2), the Zephyr Enterprise documentation moved from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise documentation page. Please see: https://support.smartbear.com/zephyr-enterprise/docs/en/migrating-to-zephyr-enterprise/via-rest-api/create-a-role.html
Create a new user role.
Use the following operation to create a user role in Zephyr Enterprise.
POST flex/services/rest/v3/role
Request format
To create a user role, send a POST request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/role
Request body
{
 "name":"Administration Role",
 "description":null,
 "roleTemplateId":"1"
}
The roleTemplateId
value specifies the level of permissions for certain applications in Zephyr. It can be either 1 (Administration Apps), or 2 (Project Apps).
Response body
#For Role Template 1
{
"id" : 106,
"name" : "Administration Role ",
"hasManagerApp" : false,
"deletable" : true,
"editable" : true,
"createdOn" : 1588062308198,
"roleTemplate" :
{"id" : 1,"templateName" : "Administration Apps","templateType" : 1,
"templateApps" : "{
 "apps": [
       {"id":1,"name":"System Setup"},
       {"id":2,"name":"User Setup"},
       {"id":3,"name":"Project Setup"},
       {"id":6,"name":"Defect Admin"},
       {"id":32,"name":"Group Setup"}
       ]
}",
"editable" : true,
"deletable" : true
},
"isProjectAppRole" : false}
For Role Template 2
{
"id" : 107,
"name" : "Project APP",
"hasManagerApp" : false,
"deletable" : true,
"editable" : true,
"createdOn" : 1588062577117,
"roleTemplate" : {
 "id" : 2,
 "templateName" : "Project Apps","templateType" : 2,"templateApps" : "
   {"apps": [
       {"id":8,"name":"Release Setup"},
       {"id":9,"name":"Requirements"},
       {"id":11,"name":"Test Planning"},
       {"id":13,"name":"Reporting"},
       {"id":15,"name":"Test Repository"},
       {"id":16,"name":"Test Execution"},
       {"id":17,"name":"Defect Tracking"},
       {"id":20,"name":"Execute All Executions"}
       ]
   }",
"editable" : true,
"deletable" : true},
"isProjectAppRole" : true
}
Assign a permission to the role
Use the following operation to assign a permission to the user role.
PUT /flex/services/rest/v3/role/permission?roleid={role ID}
Request format
To assign a permission to a user role, send a PUT request to the following URL:
http://{ZEPHYR-SERVER}/flex/services/rest/v3/role/permission?roleid={role ID}
role ID is the ID of the role of the Zephyr Enterprise user.
Request body ( Administration Apps)
Request body (Project Apps)
The applicationName
value indicates the application that can be accessed by the user who has the specified role.
Possible values:
1
- System Setup2
- User Setup3
- Project Setup6
- Defect Admin8
- Release Setup9
- Requirements11
- Test Planning13
- Reporting15
- Test Repository16
- Test Execution17
- Defect Tracking20
- Execute All Executions32
- Group Setup
Starting Release 8.2, Zephyr Enterprise documentation is moving from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise Documentation page. https://support.smartbear.com/zephyr-enterprise/docs/en/welcome-to-zephyr-enterprise.html