How to Sync Tasks in Asana

    How to Sync Tasks in Asana

    This article describes how to synchronize tasks between Asana and other systems.

    Tasks in Asana: Tasks are the primary work items in Asana containing name, description, assignee, due date, and custom fields.

    Outgoing sync (Asana → Remote system)

    To send task information from Asana to the remote system:

    replica.key = entity.key
    replica.summary = entity.summary
    replica.description = nodeHelper.stripHtml(entity.description)
    replica.assignee = entity.assignee
    replica.due = entity.due
    replica.status = entity.status
    replica.comments = nodeHelper.stripHtmlFromComments(entity.comments)
    replica.attachments = entity.attachments
    replica.customFields = entity.customFields

    Incoming sync (Remote system → Asana)

    To receive task information from the remote system and create/update Asana tasks:

    entity.summary = replica.summary
    entity.description = replica.description
    entity.due = replica.due
    entity.comments = commentHelper.mergeComments(entity, replica)
    entity.attachments = attachmentHelper.mergeAttachments(entity, replica)

    Assignee handling

    To assign tasks by email or clear assignee:

    // Assign by email
    entity.assignee = nodeHelper.getUserByEmail("user@example.com")
    
    // Clear assignee
    entity.assignee = null

    Status handling

    To mark tasks as complete or incomplete:

    // Mark task complete
    entity.setStatus("completed")
    
    // Mark task incomplete
    entity.setStatus("incomplete")

    More information

    Have more questions? Ask the community