Jump to content

How to query all priorities and set priority

lukas g

Recommended Posts

Here's a quick snippet for you.


import ftrack_api

# Your info goes here
session = ftrack_api.Session(

# Queries all priorities (so you can know their names/values/id etc)
priorities = session.query('Priority').all()
for p in priorities:
  print p.keys()

# Queries a priority by name
priority_name = 'Extreme' # 'Low, Medium, High'
priority_extreme = session.query('Priority where name is "{}"'.format(priority_name)).one()

# Queries a task/entity
ftrack_task_id = 'a2db5442-8c56-11e8-83ac-0cc47adee6c0'
ftrack_entity = session.query('Task where id is "{}"'.format(ftrack_task_id)).one()

# Set's the priority
ftrack_entity['priority'] = priority_extreme

# Commits the changes


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...