0

How to find all assets for specific project using python api

import pprint
pprint.pprint(sg.find('Asset',[],['code']))

This code gives me all Assets but i want assets for specific project how to find it ?

2 条评论

  • 0
    Avatar
    Sudeepth Patinjarayil

    Please use this code

    filters = [['code', 'is', 'Dummy Project']]

    project = sg.find('Project', filters)


    filters = [['project', 'is', project]]

    fields = ['code']

    assets = sg.find('Asset', filters, fields)

    pprint(assets)
  • 0
    Avatar
    Romain Tily

    allAsset = sg.find(
        "Asset",
        [
            ['project', 'name_is', 'Dummy Project']
        ],
        [
            'code'
        ])

请先登录再写评论。