Listens to a github issue comment event and returns the comment added

12 Views Asked by At

I am trying to build a flask application, which listens to a github issue comment event and returns the comment added. This is the code

response = requests.get(github_api_url,headers=gh_headers) github_issues = response.json()

for issue in github_issues:
    issue_id = issue["id"]
    issue_title = issue["title"]

existing_issue = mongo_collection.find_one({"title": issue_title})
print ("Existing Issue : ",existing_issue)

comment = repo.get_comments(id=issue_id)
print (comment)

issues = repo.get_issues(state="open", sort='updated')
print (issues)

But I am getting an error saying "id" is not a valid argument. Any help on this? I need to fetch the issue details on the id or name

Tried this:

response = requests.get(github_api_url,headers=gh_headers)
github_issues = response.json()

for issue in github_issues:
    issue_id = issue["id"]
    issue_title = issue["title"]

existing_issue = mongo_collection.find_one({"title": issue_title}) //searches for the issue in Mongo
print ("Existing Issue : ",existing_issue)

comment = repo.get_comments(id=issue_id) //Gives an error saying "id" is not a valid argument
print (comment)

issues = repo.get_issues(state="open", sort='updated')
print (issues)
0

There are 0 best solutions below