Skip to main content
[Latest Release Version]

SDK for managing Workfront tasks

Installation

Install via pip:

$ pip install workfront-sdk

Install from source:

$ git clone git://github.com/BridgeMarketing/workfront-sdk.git
$ cd workfront-sdk
$ python setup.py install

Examples

How to create a Workfront Service object

Create the Workfront object and login:

>>> from workfront import Workfront
>>> wf = Workfront("ay.caramba@thebridgecorp.com", "1234wfpass")
>>> wf.login()

Then you can use it.

How to create a user object

With a Workfront service object, you can create a user by email or by id:

>>> from workfront.objects import user
>>> user_by_email = user.from_email(wf, "ay.caramba@thebridgecorp.com")
>>> user_by_id = user.from_id(wf, "<WORKFRONT_USER_ID>")

You can then access some fields of the users:

>>> print user_by_email.wf_id # print the workfront id
>>> print user_by_email.name # print the name of the user
>>> print user_by_email.emailAddr # print the email of the user

How to create and interact with a Task

Create the task by it’s workfront id and giving a Workfront service

>>> from workfront.objects.task import WFTask
>>> task = WFTask(wf, "<WF_TASK_ID>")

Change the status of a task

>>> from workfront.objects.status import WFTaskStatus
>>> task.set_status(WFTaskStatus.in_progress)

Assign a task to a different user

Once you have a WF user and a task you can:

>>> from workfront.objects import user
>>> from workfront.objects.task import WFTask
>>> user_by_email = user.from_email(wf, "ay.caramba@thebridgecorp.com")
>>> task = WFTask(wf, "<WF_TASK_ID>")
>>> task.assign_to_user(user_by_email)

Get and set custom fields

You can use the methods set_param_values and get_param_values to modify and access task custom fields.

>>> task = WFTask(wf, "<WF_TASK_ID>")
>>> task.get_param_values()
>>> {"custom_field": "value", "list_field": ["value1", "value2"]}
>>> task.set_param_values({"custom_field": "other_value"})
>>> task.get_param_values()
>>> {"custom_field": "other_value", "list_field": ["value1", "value2"]}

How to use projects

You can load a project from the id, and access the template id:

>>> from workfront.objects import project
>>> p = project.WFProject(wf, "<WF_PROJECT_ID>")
>>> project_template_id = p.get_template_id()

With the template id, you can create another project:

>>> from workfront.objects import project
>>> new_project = project.crt_from_template(wf, project_template_id, "NEW PROJECT NAME")
>>> new_project.wf_id

Release files for workfront-sdk 0.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for workfront-sdk 0.25
File Size Uploaded
workfront-sdk-0.25.tar.gz 21.0 kB Details

Release files / workfront-sdk-0.25.tar.gz

Download URL workfront-sdk-0.25.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1a6c98f0d35fc4b51d6cc23bf12c5aa35c8457711d25dc22fca6c43d96ad0852
BLAKE2b-256 checksum
How to use checksums
e94056f030f2da8e21c944f40a24114bfbcef1968a2f486375865eebf361b232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.8

Release history Release notifications | RSS feed

This release

0.25 This release

1 release file

0.24

1 release file

0.23

1 release file

0.22.2

1 release file

0.22.1

1 release file

0.22

1 release file

0.21

1 release file

0.20

1 release file

0.19

1 release file

0.18

1 release file

0.17

1 release file

0.16

1 release file

0.15

1 release file

0.14

1 release file

0.13

1 release file

0.12

1 release file

0.11

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page