This article explains how to add a user to a project role using the app Run CLI Actions in Jira on Server instance.
Instructions
For this scenario, we use the addProjectRoleActors and action and userId CLI actions.parameter where:
- addProjectRoleActors: Add adding users or groups to a project role.
- userId: User id for user management and other actions. For some actions, a comma-separated list of ids.
- Ensure that the project roles are added role(s) exist on the global level. The
The below example shows a project key "JIRACLI" that has a role defined as Jira_users. Execute the below CLI action by navigating to Admin > Manage Apps > Run Actions :
Code Block theme Midnight --action addProjectRoleActors --project "JIRACLI" --role "jira_users" --userId "Lucas"
The result of the above cli action will be similar to as shown below:
Info title Info - Make sure you have installed the app, Run CLI action in Jira v9.2, as the action addProjectRoleActors is compatible with Run CLI action in Jira from v9.2
- It is recommended to test this scenario in a test environment before implementing it in production.