Jump to content

How to add a note without notifying the managers (as in Web Interface)


Lucas S.

Recommended Posts

Hey there!

I noticed that every time we create a note via ftrack's python API, it automatically notifies every manager related to that task, and maybe other people related to that task as well.

When someone adds a note to a Task via the Web Interface, this does not happen by default.

We wanted to be able to add notes into tasks and AssetVersions without notifying the managers every time. This has been affecting our ability to use the inbox properly since most of the notifications are not helpful because of this.

Is there a way to remove any recipient of a note we're creating via the API?

 

Here's a code snippet that we're using:

def createNoteInTask(note_message, task_id, session):

    task_object = session.get('Task', task_id)

    if not task_object:
        return

    username = session.api_user
    user_object = session.query("User where username is {}".format(username)).one()

    new_note = session.create("Note", {
        'author': user_object,
        'content': note_message,
        'recipients': [],
    })

    task_object['notes'].append(new_note)

    session.commit()

 

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...