def configurecreate_suspect(host_url, username, password, project_key, fieldsconfig_listname, linknotify_type_idassignee, scope, notify_assigneereporter,
notify_reporter, notify_project_lead, notify_user_listnotify_project_lead, user_keys, link_type_ids, use_all_link_types, field, stream, scope):
"""
This method is used allows to create suspect configuration on a project
"""
# The REST API path to configureallow the Requirementscreation Suspectof Configurationsuspect configuration for a project
Query parameters: path_uri [project_key] the project key= '/rest/com.easesolutions.jira.plugins.requirements/1.0/{}/suspectconfiguration'.format(project_key)
# The request body
json_data Query parameters= {'configName': config_name, 'notifyAssignee': notify_assignee, [fields_list] fields that trigger a suspect
'notifyReporter': notify_reporter,
'notifyProjectLead': notify_project_lead, 'userKeys': [user_keys], 'linkTypeIds': [link_type_idids] link types that should be affected if a field change
[scope] define if a change in an issue will trigger suspect. Accepts 'both' or 'downstream'
[notify_assignee] notify assignee if set to true
[notify_reporter] notify reporter if set to true
[notify_project_lead] notify project lead if set to true
[notify_user_list] the jira,
'useAllLinktypes': use_all_link_types, 'suspectConfigItems': [{'field': field, 'stream': stream}],
'scope': scope}
# Send and return the POST request
try:
return requests.post(host_url + path_uri, json=json_data, auth=HTTPBasicAuth(username, password))
except requests.exceptions.RequestException as e:
print e |