Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to remove a user as a Project Admin for multiple projects using the app, Run CLI action for Actions in Jira, on  Datacenter a data center instance.

Instructions

For this scenario, use the runFromCsv and addProjectRoleActorsremoveProjectRoleActors actions where: 

  • removeProjectRoleActorsRemove users or groups from a project role.
  • runFromCsv: Run actions generated from a CSV file.

    Note

    Ensure that the project role(s) and userId(s) exists on exist at the global level. 


  1. Consider the following example which shows a project key, BUMPTC, that and has a role defined as jira-administrators:
    Image RemovedImage Added

  2. Create a csv CSV file(ex: projects.csv) with the below parameters :in the first row. 
    Image Added

  3. Place the projects.csv under the respective relevant folder, that is /var/atlassian/application-data/home/cli-plugin. This location is based on your Jira instance.
  4. Navigate to Admin > Manage Apps > Run Actions to execute the following CLI action:

  5. Click on Run and below is the required output:

  6. The result of the above action is similar to the following screenshot:
    Image Removed

    Code Block
    themeMidnight
    --action run --server http://example.test.stage --password xxxxxxx --user xxxxxxx
    
    --action runFromCsv --file "projectsremove.csv" --common "--action removeProjectRoleActors"
    

    Image RemovedImage Added

  7. Click on Run and below is the required output:

    Code Block
    themeMidnight
    Success
    
    
    Run: --action runFromCsv --file "projectsremove.csv" --common "--action addProjectRoleActorsremoveProjectRoleActors"
    
    Run: --project "AAAAJIRA" --role "jira-administrators" --userId "Amulya" --category "anotherstandard" --action removeProjectRoleActors
    'jira-administrators' role updated for project AAAAJIRA
    
    Run: --project "BBBBQA" --role "jira-administrators" --userId "Amulya" --action removeProjectRoleActors
    'jira-administrators' role updated for project BBBB
    
    Run: --project "BUGAcategory "standard" --role "jira-administrators" --userId "Amulya" --action removeProjectRoleActors
    'jira-administrators' role updated for project BUGAQA
    
    Run: --project "BUMP" --role "jira-administrators" --userId "Amulya" --action removeProjectRoleActors
    'jira-administrators' role updated for project BUMP
    
    Run: --project "CCCCTC" --role "jira-administrators" --userId "Amulya" --action removeProjectRoleActors
    'jira-administrators' role updated for project CCCCTC
    
    Run: --project "EEEEZJCLI" --role "jira-administrators" --userId "Amulya" --action removeProjectRoleActors
    'jira-administrators' role updated for project EEEEZJCLI
    
    Run completed successfully. 65 actions were successful from file: /var/atlassian/application-data/home/cli-plugin/projectsremove.csv
    
    Run completed successfully. 1 actions were successful 
    


    Image Added

  8. The result of the above action actions is similar to shown in the following screenshot:
    Image Removed

...

  1. Image Added


Info
  • Make sure you have installed the Run CLI Actions in Jira v9.2 app as the action removeProjectRoleActors is compatible only with the app from v9.2.
  • It is recommended to test this scenario in a test environment before implementing it in production.