create new issue in a sprint from python jira rest api

Thulasi_savedroid September 23, 2019

 

def lambda_handler(event, context):
event_body = json.dumps(event, indent=2)
summary = event['detail-type'] + event['detail']['type']
issue_dict = {
'project': {'id': 10000},
'summary': summary,
'description': event['detail']['description'],
'issuetype': {'name': 'Bug'},
"customfield_10009": 19
}
new_issue = jira.create_issue(fields=issue_dict)

comment = jira.add_comment(new_issue, event_body)

print("Created new issue and added the :", new_issue)

 

https://confluence.atlassian.com/jirakb/creating-an-issue-in-a-sprint-using-the-jira-rest-api-875321726.html

 

followed above link and it says 

 

"errorMessages":[],"errors":
{"sprint":"Field 'sprint' cannot be set. It is not on the appropriate screen, or unknown."}

also when tried

/rest/agile/1.0/board/{boardId}/sprint


to get sprint id i get


{
  • errorMessages:    [
    • "The board does not support sprints"
    ],
  • errors: { }
}

1 answer

0 votes
robert Mugabuhamye
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2019

Hello @Thulasi_savedroid '

 

From the message error you posted, it seems like the sprint field is not on the create issue screen of your Bug.

Regards

Suggest an answer

Log in or Sign up to answer