Skip to content

Commit b5e1c51

Browse files
add files for day-15
1 parent 1cc122b commit b5e1c51

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

Day-14/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Github-JIRA intergration Project

Day-15/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Github-JIRA intergration Project - (Part-2)

Day-15/examples/hello-world.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from flask import Flask
2+
3+
app = Flask(__name__)
4+
5+
@app.route('/')
6+
def hello_world():
7+
return 'Hello, World!'
8+
9+
if __name__ == '__main__':
10+
app.run("0.0.0.0")

Day-15/github-jira.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This code sample uses the 'requests' library:
2+
# http://docs.python-requests.org
3+
import requests
4+
from requests.auth import HTTPBasicAuth
5+
import json
6+
from flask import Flask
7+
8+
app = Flask(__name__)
9+
10+
# Define a route that handles GET requests
11+
@app.route('/createJira', methods=['POST'])
12+
def createJira():
13+
14+
url = "https://veeramallaabhishek.atlassian.net/rest/api/3/issue"
15+
16+
API_TOKEN=""
17+
18+
auth = HTTPBasicAuth("", API_TOKEN)
19+
20+
headers = {
21+
"Accept": "application/json",
22+
"Content-Type": "application/json"
23+
}
24+
25+
payload = json.dumps( {
26+
"fields": {
27+
"description": {
28+
"content": [
29+
{
30+
"content": [
31+
{
32+
"text": "Order entry fails when selecting supplier.",
33+
"type": "text"
34+
}
35+
],
36+
"type": "paragraph"
37+
}
38+
],
39+
"type": "doc",
40+
"version": 1
41+
},
42+
"project": {
43+
"key": "AB"
44+
},
45+
"issuetype": {
46+
"id": "10006"
47+
},
48+
"summary": "Main order flow broken",
49+
},
50+
"update": {}
51+
} )
52+
53+
54+
response = requests.request(
55+
"POST",
56+
url,
57+
data=payload,
58+
headers=headers,
59+
auth=auth
60+
)
61+
62+
return json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))
63+
64+
if __name__ == '__main__':
65+
app.run(host='0.0.0.0', port=5000)

0 commit comments

Comments
 (0)