Python Jira Server API Dashboard Duplication Issue

I’m trying to duplicate dashboards programmatically using Python and the Jira REST API but running into problems. My script can fetch existing dashboards just fine, but when I try to create a copy it fails.

from jira import JIRA

# Establish connection
server_config = {'server': 'https://my-jira-server'}
client = JIRA(options=server_config, basic_auth=('username', 'password'))

# Get my dashboards
user_dashboards = client.dashboards(filter='my')
print(f"Found {len(user_dashboards)} dashboards")

# List all dashboards
for board in user_dashboards:
    print(f"ID: {board.id}, Title: {board.name}")
    
# This part works fine

# Try to duplicate dashboard
original_id = '12345'
duplicate_name = 'Automated Copy'
duplicate_desc = 'Created via Python'

# This returns None
result = client.copy_dashboard(id=original_id, 
                              name=duplicate_name,
                              description=duplicate_desc)

if result:
    print(f"Successfully created dashboard: {result.id}")
else:
    print("Duplication failed")

The copy operation always returns None. When I test the API endpoint directly I get a 405 error. I’ve tried different approaches but none work. Starting to think dashboard copying isn’t available in Jira Server version. Has anyone else encountered this limitation?

i know how you feel! the jira server api can b really tricky for duplicating dashboards. sometimes, manual setup is the only way to go. i mean, it sucks, but you’ll end up with something customized the way you want.

Yeah, you’ve hit one of the big gaps between Jira Server and Cloud APIs. Server just doesn’t have dashboard duplication in its REST endpoints - that’s why you’re getting the 405 error.

I ran into this same thing about six months ago during our reporting migration. Ended up building a custom solution that pulls dashboard structure through direct database queries (if you’ve got DB access) or scrapes the config pages. Not pretty, but it worked for our bulk migration.

You could also try Jira’s export/import if you’re moving between instances, though that won’t help for programmatic duplication on the same server. Server’s API is just way more limited than Cloud when it comes to dashboard management.

You’re right - Jira Server doesn’t support dashboard duplication through the REST API. That copy_dashboard method you’re using is Cloud-only, which is why you’re getting the 405 error.

I built a workaround that grabs the gadget config from the original dashboard and recreates each one on a new dashboard. It’s messier but works. You’ll need to hit the gadgets endpoint for the config data, create your new dashboard, then manually add each gadget with its settings. Not pretty, but it’s the only programmatic solution I’ve found that actually works with Server.