Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,557,830
Community Members
 
Community Events
184
Community Groups

Can't update the permission scheme of a project via the correct json?

Piyush Annadate
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 18, 2023

How to update the permission scheme of a project to a new role id:

role_a_id - id of role source

role_a_id - id of role to replace to
def permissionSchemeUpdate(project_key,role_a_id,role_b_id):
    permission_schemes = jira.project_permissionscheme(project_key)
    print(f"project Key: {project_key} --> Permission Scheme: {permission_schemes.name}")
    scheme_url = f'{urlBase}/rest/api/3/permissionscheme/{permission_schemes.id}'
    response = requests.get(scheme_url, auth=(username, api_token), headers=headers)
    scheme_data = response.json()
    for scheme in scheme_data['permissions']:
        if role_a_id == scheme['holder']['value']:
            print(f"Role found for '{project_key}' at {scheme['permission']}")
            update_url = f'{urlBase}/rest/api/3/permissionscheme/{scheme_data["id"]}'
            scheme['holder']['parameter'] = role_b_id
            scheme['holder']['value'] = role_b_id
            response = requests.put(update_url, auth=(username, api_token), headers=headers, json=scheme_data)
            print(scheme_data['name'])
            if response.status_code == 200:
                print(f"Permission updated in scheme '{scheme_data['name']}'")
Error: Name required field not passed.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events