Skip to content

Debug get-sprint-data.py #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions scripts/get-sprint-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_ql_query_response(access_token, query):
raise Exception(
f"Query failed to run with a status code {response.status_code}. Response: {response.text}"
)
return response.json()
return None


def get_project_id(project_number, access_token):
Expand All @@ -77,13 +77,16 @@ def get_project_id(project_number, access_token):

data = get_ql_query_response(query=query, access_token=access_token)

# Extract project board ID
try:
project_id = data["data"]["organization"]["projectV2"]["id"]
return project_id
except KeyError:
print("Project board not found.")
return None
if data is not None:
# Extract project board ID
try:
project_id = data["data"]["organization"]["projectV2"]["id"]
return project_id
except KeyError:
print("Project board not found.")
return None
else:
print("your query did not return any data")


def get_project_field(project_id, access_token):
Expand Down