2

How can all of the fields be displayed for 'Project' using the workfront-api in Python? The examples below return the default fields, but fields=* and fields=All return syntax errors.

Examples using the Workfront examples in api.py and test.py that work:

results = client.search(ObjCode.PROJECT,{'groupID':user.homeGroupID})
results = client.search(ObjCode.PROJECT,{'groupID':user.homeGroupID},fields=None)
Ivan
  • 34,531
  • 8
  • 55
  • 100
VTISCHUK
  • 27
  • 4

1 Answers1

0

fields='*' or fields=['*'] should work just fine.

results = client.search(ObjCode.PROJECT,{'groupID':user.homeGroupID},fields=['*'])

It won't return collections or references. For that, you would need something like this:

results = client.search(ObjCode.PROJECT,{'groupID':user.homeGroupID},fields=['*','owner:*'])

Craig
  • 326
  • 2
  • 12
  • How do you read custom field values that are returned to a variable? In the example above if I had a custom field in project called "Custom Field" I understand I can search it by saying results = client.search(ObjCode.PROJECT,{'groupID':user.homeGroupID},fields=['DE:Custom Field']) How would I the read the value of the custom field? – Gregory Lancaster May 15 '18 at 16:45
  • The value should just return as a key/value pair in the JSON result. For example {'ID":'ABC123', 'DE:Custom Field':'My Custom Form Data Value Here'} – Craig May 20 '18 at 23:52