project_id = "10000"
filter_name = "GUI Coverage"
is_public = "true"
columns = '{"label":"Level 1","jiraJql":"","jiraFilterId":"","linkTypes":[{"id":"-1","directions":{"in":true,"out":true}}],"currentIssueTypes":["-1"],"projects":["10000,PA,Project A","10002,PB,Project B"],"fromLevel":-1}, ' \
'{"label":"Level 2","jiraJql":"","jiraFilterId":"10004","linkTypes":[{"id":"-1","directions":{"in":true,"out":true}}],"currentIssueTypes":[],"projects":["10000,PA,Project A"],"fromLevel":0}, ' \
'{"label":"Level 3","jiraJql":"assignee IS NOT EMPTY","jiraFilterId":"","linkTypes":[{"id":"10001","directions":{"in":false,"out":true}}],"currentIssueTypes":[],"projects":["10000,PA,Project A"],"fromLevel":1}'
column_data = '{"columns":[' + columns + '],"projectId":' + project_id + ',"fields":[],"folderIssueKeys":[],"filterId":0,"folderId":0,"folderName":"","fromColumn":0,"isFiltered":false}'
display_fields = '["issuetype","issuekey","status","priority","summary","assignee","reporter"]'
# Store the result of the POST request to [response]
response = create_coverage_view(HOST_URL, USERNAME, PASSWORD, project_id, filter_name, is_public, column_data, display_fields)
# Check response if coverage view is created
if response.status_code == 201:
print response.text
else:
print 'Error code: ', response.status_code
print response.text |