Duplicating a Jira Dashboard via REST API in Python

Trying to duplicate a Jira dashboard using Python’s REST API. The existing method returns None and a 405 error. Below is an alternate code snippet:

from jira_client_api import JiraConnector

# Establish connection
config = {"server": "https://jira.example.com"}
connector = JiraConnector(config, user='user_ex', password='pass_ex')

dash_list = connector.list_dashboards()
print(f"Found {len(dash_list)} dashboards")

# Duplicate dashboard
orig_id = '22222'
new_title = 'Replicated Dashboard'
new_summary = 'Automated Copy'

cloned_dash = connector.duplicate_dashboard(dashboard_id=orig_id, title=new_title, summary=new_summary)
if cloned_dash:
    print(f"Dashboard cloned: {cloned_dash.id}")
else:
    print("Cloning failed.")

maybe issue is with wrong http method or perms, i seen 405s when trying to duplicate with an incorrect endpoint. check the api docs for required configs mayb also test with different headers. good luc!

Based on my experience working with Jira’s REST API, the 405 error you are encountering might be due to a deprecated or unsupported endpoint for duplicating dashboards. I faced a similar issue and resolved it by verifying that the API method aligns with the current documentation. Ensure that the endpoint you are using matches the recommended HTTP verb and that any required fields or permissions are set. It might also be beneficial to manually test the endpoint with tools like Postman to better understand what parameters may be missing or incorrectly specified.