Created
May 1, 2021 21:08
-
-
Save kuharan/d74d27cb8f5b29ad50b22edd7c744561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
def open_incidents_test(incident): | |
url = "https:/xxxx/api/koi/servicenow_incident_api/update" | |
payload = json.dumps({ | |
"Incident_Update": { | |
"number": incident, | |
"state": "New", | |
"work_notes": "xxxx", | |
"additional_comments": "xxxx" | |
} | |
}) | |
headers = { | |
'Authorization': 'Basic XXXX', | |
'Content-Type': 'application/json' | |
} | |
response = requests.patch(url, headers=headers, data=payload) | |
return response.text | |
for incident in ['INCXXXX', 'INCXXXX' 'INCXXXX']: | |
status = open_incidents_test(incident) | |
print(status) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment