Skip to main content

It's always bugged me that, when you attach a Notion page to a Linear issue, it doesn't automatically show the Notion page's title, because Linear doesn't "inherit" your access to the Notion page. So I built a Zap with a custom Linear integration to do it myself!

  1. I created a webhook in Linear that fires whenever a new Issue Attachment is created or updated, and set up a Zap trigger to receive it
  2. A path filters for attachments where source = notion
  3. A Formatter step strips the Notion page ID from the attachment URL
  4. A Notion retrieve page step to get the page's title
  5. My custom private Linear integration updates the attachment title and sets it to the title of the Notion page. (Linear's native Zapier integration doesn't support this, so I built my own).

 

Here's the code for this action if you want to build your own custom Linear integration:

const options = {
  url: 'https://api.linear.app/graphql',
  method: 'POST',
  headers: {
    'Authorization': `${bundle.authData.api_key}`,
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  body: {
    query: `mutation {
      attachmentUpdate(
        id: "${bundle.inputData.attachmentId }"
        input: {
          title: "${bundle.inputData.attachmentTitle}"
        }
      ) {
        success
      }
    }`
  }
};

return z.request(options)
  .then((response) => {
    console.log("Hardcoded Test Request:", JSON.stringify(options, null, 2));
    return response.json;
  });

 

Love this ​@DennisWF 🤗 Thanks for taking the time to document this so thoroughly and for sharing the code—we really appreciate it! 

Keep up the excellent work! 👏