MCPcopy Index your code
hub / github.com/iam-veeramalla/python-for-devops / createJira

Function createJira

Day-15/github-jira.py:12–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10# Define a route that handles GET requests
11@app.route('/createJira', methods=['POST'])
12def 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
64if __name__ == '__main__':
65 app.run(host='0.0.0.0', port=5000)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected