Skip to content

[Bug] --list flag returns inconsistent output format between object types in JamfObjectReader #330

@hoarek

Description

@hoarek

Describe the bug
The --list flag for the read command produces inconsistent output formats depending on the object type. For some object types (like policy), it correctly returns a simplified list with just id and name fields, but for others (like script), it returns the full object with all details including script contents, parameters, and other data.

To Reproduce
Steps to reproduce the behavior:

  • Processor: JamfObjectReader
  • Parameters: --list flag with different object types
  1. Test with policy objects (works correctly):
    ./jamf-upload.sh read --type policy --list --url https://example.jamfcloud.com

  2. Test with script objects (shows inconsistent behavior):
    ./jamf-upload.sh read --type script --list --url https://example.jamfcloud.com

Expected behaviour
The --list flag should consistently return only id and name fields for all object types, as described in the help text: "Output a list all objects and nothing else". Both commands should produce similar simplified output structures.

Log output
Policy objects (working correctly):

[
    {
        "id": 165,
        "name": "Auto-Update - 1Password - Ongoing"
    },
    {
        "id": 166,
        "name": "Auto-Update - 1Password - Self Service"
    }
]

Script objects (not working correctly - returns full objects - truncated):

[
    {
        "id": "59",
        "name": "hello_world.sh",
        "info": "",
        "notes": "",
        "priority": "AFTER",
        "parameter4": "",
        "parameter5": "",
        "parameter6": "",
        "parameter7": "",
        "parameter8": "",
        "parameter9": "",
        "parameter10": "",
        "parameter11": "",
        "osRequirements": "15.x",
        "scriptContents": "#!/bin/zsh\n[full script content...]"
    }
]

Environment (please complete the following information):

  • OS: macOS 26.0.1
  • AutoPkg version 2.7.3
  • Are you using the processors in grahampugh/jamf-upload (bleeding edge) or autopkg/grahampugh-recipes (stable)? grahampugh/jamf-upload
  • Are you running a different branch to main? Main

.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions