Search code examples
pythonpython-jira

jira.create_sprint() returns JiraError HTTP 500 No Content to map to Object due to end of input


Using python and jira==3.0.1 I receive the following error when attempting to create a sprint.

JIRAError: JiraError HTTP 500 url: https://issues.redhat.com/rest/greenhopper/1.0/sprint/10875
    text: No content to map to Object due to end of input

My code snippet follows:

jira.create_sprint(name=sprint,
                    startDate=start_dttm,
                    endDate=end_start_dttm,
                    board_id=10875
                    ) 

And I've tried with board_id=10875 where I obtained the id from https://jira.somwhere.com/secure/RapidBoard.jspa?rapidView=10875 and with board_id="PROJECT_KEY". Both return the same error.

Looking for some assistance to get past this error.

Thanks!


Solution

  • Per response received from the github issue submitted, the following code is required: options={"agile_rest_path": GreenHopperResource.AGILE_BASE_REST_PATH}

    My working code is as follows:

    from jira.resources import GreenHopperResource
    
    jira = JIRA(server="https://issues.example.com", 
                basic_auth=(os.environ.get('user'), os.environ.get('password')),
                options={"agile_rest_path": GreenHopperResource.AGILE_BASE_REST_PATH},
    )
    
    jira.create_sprint(name=sprint,
                        startDate=start_dttm,
                        endDate=end_start_dttm,
                        board_id="<board_id>"
                        )