Skip to content
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

Unable to list the support cases via describe_cases() #3967

Closed
vedimuthan opened this issue Dec 7, 2023 · 2 comments
Closed

Unable to list the support cases via describe_cases() #3967

vedimuthan opened this issue Dec 7, 2023 · 2 comments
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged.

Comments

@vedimuthan
Copy link

Describe the bug

I am unable to see the list of AWS support cases created using the boto3 function describe_cases(). I am actually looking for the particular caseId from the list of support cases.

Expected Behavior

{
    'cases': [
        {
            'caseId': 'string',
            'displayId': 'string',
            'subject': 'string',
            'status': 'string',
            'serviceCode': 'string',
            'categoryCode': 'string',
            'severityCode': 'string',
            'submittedBy': 'string',
            'timeCreated': 'string',
            'recentCommunications': {
                'communications': [
                    {
                        'caseId': 'string',
                        'body': 'string',
                        'submittedBy': 'string',
                        'timeCreated': 'string',
                        'attachmentSet': [
                            {
                                'attachmentId': 'string',
                                'fileName': 'string'
                            },
                        ]
                    },
                ],
                'nextToken': 'string'
            },
            'ccEmailAddresses': [
                'string',
            ],
            'language': 'string'
        },
    ],
    'nextToken': 'string'
}

Current Behavior

{'cases': [], 'ResponseMetadata': {'RequestId': 'XXXXXX-XXX-XXX-XXX-XXX', 'HTTPStatusCode': 200, 'HTTPHeaders': {'date': 'Thu, 07 Dec 2023 19:48:32 GMT', 'content-type': 'application/x-amz-json-1.1', 'content-length': '12', 'connection': 'keep-alive', 'x-amzn-requestid': 'XXXXXX-XXX-XXX-XX-XXX'}, 'RetryAttempts': 0}}

Reproduction Steps

    support_client = member_session.client('support')
    output_file = "support_case_found_details.txt"
    with open(output_file, 'a') as file:            
        next_token=None
        while True:
            if next_token:
                response = support_client.describe_cases(NextToken=next_token)
            else:
                response = support_client.describe_cases()

            print(f"Cases: {response}\n")

            try:
                for case in response['cases']:
                    if case['caseId'] == parsed_args.supportcase_id:
                        file.write(f"Support Case ID: {case['caseId']} found in Account ID: {account_id}\n")
                        return  # Exit early if the case is found in any account
            except Exception as e:
                print(f"An error occurred: {e}")

            # Check if there are more pages
            next_token = response.get('nextToken')
            if not next_token:
                break

Possible Solution

Should be able to return the list of support cases.

Additional Information/Context

N/A

SDK version used

1.28.84

Environment details (OS name and version, etc.)

MacBook Pro Ventura 13.5.2

@vedimuthan vedimuthan added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Dec 7, 2023
@vedimuthan
Copy link
Author

Closing this since it returns only the open cases. I just added the flag includeResolvedCases=True and I was able to see the cases.

Copy link

github-actions bot commented Dec 8, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant