-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
40 additions
and
34 deletions.
There are no files selected for viewing
Binary file not shown.
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,11 @@ | ||
""" | ||
you are an intelligent assistant who is expert in understanding user problem , | ||
you can translate any {instruction} into a json document to be used to create jira service ticket. | ||
While returning the json make sure to use the below keys only : | ||
|
||
Title | ||
Summary | ||
|
||
follow the below conditions very strictly : | ||
just include the json in the output nothing extra | ||
""" |
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 |
---|---|---|
@@ -1,28 +1,27 @@ | ||
import requests | ||
import json | ||
import requests ,json | ||
|
||
url="https://thetotaltechnology.atlassian.net/rest/api/2/issue" | ||
headers={ | ||
"Accept": "application/json", | ||
"Content-Type": "application/json" | ||
"Accept":"application/json", | ||
"Content-Type":"application/json" | ||
} | ||
def generate_ticket(data): | ||
payload=json.dumps( | ||
{ | ||
"fields": { | ||
"project": | ||
{ | ||
"id": "10000" | ||
}, | ||
"summary": "created for test11", | ||
"description": "Created for test11", | ||
"issuetype": { | ||
"name": "Task" | ||
} | ||
} | ||
} | ||
) | ||
response=requests.post(url,headers=headers,data=payload,auth=("")) | ||
data=response.json() | ||
return data | ||
def gen_ticket(data): | ||
payload=json.dumps( | ||
{ | ||
"fields":{ | ||
"project":{ | ||
"id":"10000", | ||
|
||
}, | ||
"summary":data["Title"], | ||
"description":data["Summary"], | ||
"issuetype":{ | ||
"name":"Task" | ||
} | ||
|
||
} | ||
} | ||
) | ||
response=requests.post(url,headers=headers,data=payload,auth=("[email protected]","xxxC")) | ||
data=response.json() | ||
return data |
Binary file not shown.