Public
Like
2
Discord-to-Linear
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v76View latest version
This automation automatically creates Linear tickets when team members react to Discord messages with the ๐งฟ emoji. It's perfect for capturing important discussions, bug reports, feature requests, or any message that needs to become a trackable task.
In your Val Town environment, set these three required variables:
-
DISCORD_BOT_TOKEN
- Go to Discord Developer Portal
- Create a new application โ Bot
- Copy the bot token
- Required permissions: "Read Message History" and "Add Reactions"
-
LINEAR_API_KEY
- Go to Linear โ Settings โ API
- Create a Personal API key
- Copy the key
-
LINEAR_TEAM_ID
- Use the setup dashboard to find your team ID
- Or check Linear's URL when viewing your team
- In Discord Developer Portal, go to OAuth2 โ URL Generator
- Select "bot" scope
- Select permissions: "Read Message History", "Add Reactions"
- Use the generated URL to add the bot to your server
- Open the setup dashboard (
/setup-dashboard.ts
) - Check that all environment variables show as "Set"
- Use the test form to create a ticket from any Discord message
- Verify the ticket appears in Linear
- Find a message in Discord that needs to become a Linear ticket
- React with ๐งฟ (the charmaine emoji)
- Wait a moment - the automation will:
- Fetch the full message content
- Create a Linear ticket with a descriptive title
- Include the message content and a link back to Discord
- Add the "discord-import" label
The Linear ticket will contain:
- Title: First 100 characters of the Discord message
- Description:
- Link to the original Discord message
- Author information
- Full message content
- Any attachments or embeds
- Label: "discord-import" (automatically created)
- Priority: Medium (configurable)
Edit /backend/config.ts
to customize:
export const CONFIG = {
TARGET_EMOJI: "๐งฟ", // Change the trigger emoji
LINEAR_LABEL_NAME: "discord-import", // Change the label name
LINEAR_PRIORITY: 3, // 1=Urgent, 2=High, 3=Medium, 4=Low
MAX_TITLE_LENGTH: 100, // Maximum characters in ticket title
} as const;
โ Good use cases:
- Bug reports from users
- Feature requests
- Important discussions that need follow-up
- Action items from meetings
- Customer feedback
- Technical issues
โ Avoid for:
- Casual conversations
- Already resolved issues
- Duplicate reports (check Linear first)
For best results, ensure Discord messages:
- Have clear, descriptive content
- Include relevant context
- Mention specific steps or requirements
- Include screenshots/attachments when helpful
- Anyone can trigger: Any team member can react with ๐งฟ
- Review tickets: Regularly review "discord-import" labeled tickets
- Triage and assign: Move tickets to appropriate projects/assignees
- Update status: Remove the "discord-import" label once triaged
"Environment variable not set" error:
- Check that all three environment variables are configured
- Verify there are no extra spaces in the values
"Discord API error" messages:
- Verify the bot token is correct
- Ensure the bot is in the Discord server
- Check bot permissions include "Read Message History"
"Linear API error" messages:
- Verify the Linear API key is valid
- Check that the team ID exists and you have access
- Ensure the API key has permission to create issues
Tickets not being created:
- Check the automation logs for errors
- Verify you're using the exact ๐งฟ emoji
- Test with the setup dashboard first
- Check the setup dashboard for configuration status
- Use the test form to isolate issues
- Check Val Town logs for detailed error messages
- Verify permissions in both Discord and Linear
- Monitor the "discord-import" label in Linear
- Review automation logs in Val Town
- Check for any failed ticket creations
- The automation typically creates tickets within 5-10 seconds
- Failed attempts are logged with detailed error messages
- No rate limiting issues under normal usage
- Train your team on when and how to use the ๐งฟ reaction
- Set up Linear workflows to handle imported tickets
- Regular cleanup of the "discord-import" label
- Monitor for duplicates before reacting to messages
- Use descriptive Discord messages for better ticket titles
Need help? Check the setup dashboard or review the automation logs in Val Town for detailed error information.