-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maxwell Brown <[email protected]>
- Loading branch information
1 parent
54f2bf0
commit 87423e9
Showing
3 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import requests | ||
import argparse | ||
|
||
from GenerateCSV import validProjectKey | ||
|
||
API_LINK = "/rest/api/2/" | ||
|
||
def main(): | ||
args = parseArguments() | ||
auth = (args.user, args.password) | ||
editIssue("ED-1", args.url, auth) | ||
pass | ||
|
||
def parseArguments(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--url', type = str, help = "url of your jira site", required = True) | ||
parser.add_argument('--user', type = str, help = "your jira username", required = True) | ||
parser.add_argument('--password', type = str, help = "your jira api key", required = True) | ||
parser.add_argument('--projkey', type = str, nargs='+', help = "project keys that you want updated", required = False) | ||
args = parser.parse_args() | ||
return args | ||
def editIssue(issueKey, url, auth): | ||
apiUrl = url + API_LINK + "issue/" + issueKey | ||
|
||
updateJson = { | ||
"fields": {"summary": "What fun"} | ||
} | ||
response = requests.put(apiUrl, json = updateJson, auth = auth) | ||
assert (response.status_code == 200 or response.status_code == 204), f"Expected a response code of 200 or 204. Received a response code of {response.status_code}" | ||
|
||
if __name__ == "__main__": | ||
main() |