0

Reference for field values?

I'm wondering if there's some kind of global reference repository for all available parameters for each entity type. I'm trying to add a Task to a project, specifying the "Project," "Assigned To," "Task" (name), and "Status" fields (at a bare minimum).


The current syntax I'm trying to use is below (basically just spraying and praying with field names here), but I keep running into errors when trying to fill various columns (since apparently the column names don't actually correspond to the values one would call through the API), so I'm wondering if there's a way to find all the available fields to customize a Task object (or any other kind of Shotgun object).

    renderJobData = {
        'project': {'type':'Project',

                    'id':64},

        'sg_status_list':'fin',

        'Type':'Render',

        'task':'Sample Render Task v01',
        'assigned_to':{'type':'User',
                'id':47},
        }

    result = sg.create('Task', renderJobData)

 

Can someone at least fill me in on how to assign these fields?

 

Thanks in advance,

-Nathan

3 comments

  • 0
    Avatar
    Gavin Greenwalt

    How about the "Fields" page under admin?   Check "Field_Code".

  • 0
    Avatar
    Nathan Rusch

    Yeah, chock that one up to a lack of thorough poking around... Thanks though.

  • 0
    Avatar
    KP

    We have a more reliable way now to get this information through the API. Check out the method reference for schema_field_read(). It will show you all of the details about a specific field on an entity. But if you leave the field name out, it will return all of the details for the fields on an entity. You can use that as a reference, or utilize it in your scripts however you like. Simply collect the keys to catch all of the field names currently available on an entity.

    We actually now have a schema_field_read() method where you can actually see details of the a specific field on an entity, or just see all of the fields and their settings for an entity type. You can collect the keys from this call to get all of the field names.

    https://shotgunsoftware.zendesk.com/forums/48807/entries/21668#schema_field_read

    And then of course there's some other methods there to create, update, and delete fields now through the API. Keep in mind this is all with API3.

    have fun!

Please sign in to leave a comment.