jira: Fix JSON post requests for create and edit commands.

This commit is contained in:
John Pellman 2018-07-11 16:24:17 -04:00 committed by Tim Abbott
parent 91135fca09
commit 91b570aca8
5 changed files with 12 additions and 16 deletions

View file

@ -3,10 +3,9 @@
"api_url": "https://example.atlassian.net/rest/api/2/issue",
"method": "POST",
"headers": {
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz",
"Content-type": "application/json"
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz"
},
"data": {
"json": {
"fields": {
"summary": "Testing",
"project": {

View file

@ -3,10 +3,9 @@
"api_url": "https://example.atlassian.net/rest/api/2/issue",
"method": "POST",
"headers": {
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz",
"Content-type": "application/json"
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz"
},
"data": {
"json": {
"fields": {
"summary": "Testing",
"project": {

View file

@ -3,10 +3,9 @@
"api_url": "https://example.atlassian.net/rest/api/2/issue/TEST-16",
"method": "PUT",
"headers": {
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz",
"Content-type": "application/json"
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz"
},
"data": {
"json": {
"fields": {
"description": "description"
}

View file

@ -3,10 +3,9 @@
"api_url": "https://example.atlassian.net/rest/api/2/issue/TEST-13",
"method": "PUT",
"headers": {
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz",
"Content-type": "application/json"
"Authorization": "Basic ZXhhbXBsZUBleGFtcGxlLmNvbTpxd2VydHkhMTIz"
},
"data": {
"json": {
"fields": {
"summary": "Change the summary",
"project": {

View file

@ -177,8 +177,8 @@ class JiraHandler(object):
elif create_match:
jira_response = requests.post(
self.domain_with_protocol + '/rest/api/2/issue',
headers={'Authorization': self.auth, 'Content-type': 'application/json'},
data=make_create_json(create_match.group('summary'),
headers={'Authorization': self.auth},
json=make_create_json(create_match.group('summary'),
create_match.group('project_key'),
create_match.group('type_name'),
create_match.group('description'),
@ -202,8 +202,8 @@ class JiraHandler(object):
jira_response = requests.put(
self.domain_with_protocol + '/rest/api/2/issue/' + key,
headers={'Authorization': self.auth, 'Content-type': 'application/json'},
data=make_edit_json(edit_match.group('summary'),
headers={'Authorization': self.auth},
json=make_edit_json(edit_match.group('summary'),
edit_match.group('project_key'),
edit_match.group('type_name'),
edit_match.group('description'),