Quickly add all permissions for user/group via REST?

Hi all,

I have a JIRA Server instance that I use for testing, and after I (on occasion) restart this instance and reset our database, I need to re-add project-level permissions for our testing users that don't exist in our live instance. I want to do this via a reset script, which is why I need to use REST. I know I can do this by adding each permission individually into the REST post message, but is there a simpler/faster way to update multiple group permissions for a specific scheme? Thanks in advance.

1 answer

Hi I think it looks like you can grant all you want per scheme.

https://docs.atlassian.com/jira/REST/cloud/#api/2/permissionscheme

What is your challenge here?

The challenge is that using that endpoint, I have to make a REST call 32 times to grant all permissions to a new user/group. That is really slow and makes for a lot of messy code. I was hoping there was a way to bulk update the permissions - send one REST message, update all the permissions at once. I know this is unlikely, but I thought I would ask.

If you create it for one project and use the same scheme for all? That is maybe not applicable for your testing.

Niclas Sandström [Riada] is right and you can update all permissions for a permission scheme at once. Please check the update method:

{
    "name": "Example permission scheme",
    "description": "description",
    "permissions": [
        {
            "holder": {
                "type": "group",
                "parameter": "jira-developers"
            },
            "permission": "ADMINISTER_PROJECTS"
        },
        {
            "holder": {
                "type": "group",
                "parameter": "jira-developers"
            },
            "permission": "MANAGE_SPRINTS_PERMISSION"
        },
...
    ]
}

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Dec 06, 2018 in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

5,629 views 22 17
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you