How to Create a Workflow Triggered by Updated Labels on a Linear Ticket to Generate a New Ticket on a Different Team Board?

This topic was automatically generated from Slack. You can find the original thread here.

I need to create a workflow where the trigger is when a Linear ticket has an updated label. I want the trigger to kick off when a specific label was added to the Linear ticket. Then, the next action is the workflow will create a new ticket on a different linear team board.

To create a workflow in Pipedream where the trigger is when a Linear ticket has an updated label, and the action is to create a new ticket on a different Linear team board, you can follow these steps: ### Step 1: Set up the Trigger 1. Search for the Linear (OAuth) app in the trigger menu. 2. Select the “New Updated Issue (Instant)” trigger. This trigger will activate when an issue in Linear is updated, which includes label changes. 3. Connect your Linear (OAuth) account to Pipedream. 4. Select one or more Team IDs or pass an array of strings from a previous step to specify which team’s issues you want to monitor. 5. Follow the instructions on the trigger configuration screen. You may need to generate a test event from Linear to get real data to test your workflow. ### Step 2: Add a Filter Action (Optional) If you want the workflow to trigger only when a specific label is added, you can add a filter action to check if the label you are interested in is present in the updated issue. ### Step 3: Create a New Ticket on a Different Linear Team Board 1. Add a new action in your workflow. 2. Search for the Linear (OAuth) app in the action menu. 3. Select the “Create Issue” action. 4. Connect your Linear (OAuth) account if not already connected. 5. Configure the action to create a new ticket on the desired team board. You will need to specify the team ID, issue title, description, and any other relevant fields. ### Example Code for Creating a New Issue Here’s an example of how you might structure the code to create a new issue using the Linear API: import { axios } from "@pipedream/platform"; export default defineComponent({ props: { linear: { type: "app", app: "linear", }, }, async run({ steps, $ }) { const data = { query: ` mutation { issueCreate( input: { teamId: "your-team-id", title: "New Issue Title", description: "Description of the issue" } ) { success issue { id title } } } `, }; return await axios($, { method: "post", url: `https://api.linear.app/graphql`, headers: { Authorization: `Bearer ${this.linear.$auth.oauth_access_token}`, "Content-Type": `application/json`, }, data, }); }, }); Replace "your-team-id", "New Issue Title", and "Description of the issue" with the appropriate values for your use case. ### Additional Notes - Ensure you have the necessary permissions in Linear to create issues on the specified team board. - Test your workflow thoroughly to ensure it behaves as expected when labels are updated. For more details on using Linear with Pipedream, you can refer to the Linear (OAuth) integration documentation.

I need to create a workflow where the trigger is when a Linear ticket has an updated label. I want the trigger to kick off when a specific label was added to the Linear ticket. Then, the next action is the workflow will create a new ticket on a different linear team board. I need to know to set up the filter in scenarios that a linear tickets has multiple labels. I need the workflow to only continue if one of the labels added to a linear ticket exists.

To create a workflow in Pipedream that triggers when a Linear ticket has an updated label and continues only if a specific label is added, you can follow these steps: ### Step 1: Set Up the Trigger 1. Search for the Linear (OAuth) app from the trigger menu in Pipedream. 2. Select the “New Updated Issue (Instant)” trigger. This trigger will activate when an issue in Linear is updated. 3. Connect your Linear (OAuth) account. 4. Select one or more Team IDs or pass an array of strings from a previous step. This will specify which team’s issues you want to monitor. ### Step 2: Add a Filter to Check for the Specific Label 1. Search for the Filter app from the step menu. 2. Select the “Continue execution if a condition Is met” action. 3. Connect your Filter account. 4. Select the Initial value: This should be the list of labels from the Linear issue update event. You can access this from the trigger step’s output. 5. Select a Condition: Set a condition to check if the specific label you are interested in is present in the list of labels. You can use a condition like labels.includes("specific-label"), where "specific-label" is the label you want to check for. ### Step 3: Create a New Ticket on a Different Linear Team Board 1. Add a new action step in your workflow. 2. Search for the Linear (OAuth) app again. 3. Select the action to create a new issue. 4. Connect your Linear (OAuth) account if not already connected. 5. Configure the action to create a new ticket on the desired team board. You can specify the details of the new ticket, such as title, description, and team ID. ### Testing the Workflow - Generate a test event from Linear by updating an issue and adding the specific label. - Run the workflow to ensure it triggers correctly and creates a new ticket only when the specific label is added. By following these steps, you can ensure that your workflow only continues when a specific label is added to a Linear ticket, and then creates a new ticket on a different team board. If you need further assistance, please visit Pipedream Support.

please give more instruction about this . Select a Condition: Set a condition to check if the specific label you are interested in is present in the list of labels. You can use a condition like labels.includes("specific-label"), where "specific-label" is the label you want to check for.

To set a condition to check if a specific label is present in a list of labels, you can use JavaScript’s includes method. Here’s a step-by-step guide on how to implement this in a Pipedream workflow: 1. Create a Code Step: In your Pipedream workflow, add a new code step where you want to check for the presence of a specific label. 2. Access the List of Labels: Ensure you have access to the list of labels you want to check. This could be from a previous step in your workflow. 3. Use the includes Method: Write a condition using the includes method to check if the specific label is present in the list. Here’s an example: export default defineComponent({ async run({ steps, $ }) { // Example list of labels const labels = steps.previousStep.labels; // Replace with your actual data source // The specific label you want to check for const specificLabel = "specific-label"; // Check if the specific label is present in the list if (labels.includes(specificLabel)) { console.log(`Label "${specificLabel}" is present.`); // Add your logic here for when the label is present } else { console.log(`Label "${specificLabel}" is not present.`); // Add your logic here for when the label is not present } }, }); 4. Add Logic Based on the Condition: Depending on whether the label is present or not, you can add additional logic to handle each case. This example assumes you have a list of labels available from a previous step in your workflow. Adjust the labels variable to match the actual data source in your workflow.

I need to create a workflow where the trigger is when a Linear ticket has an updated label. I want the trigger to kick off when a specific label was added to the Linear ticket. Then, the next action is the workflow will create a new ticket on a different linear team board. I need to know to set up the filter in scenarios that a linear tickets has multiple labels. I need the workflow to only continue if one of the labels added to a linear ticket exists. I need a filtering step that will check if the Linear ticket has the specific label so the workflow can continue

To create a workflow in Pipedream where the trigger is an updated label on a Linear ticket, and the workflow continues only if a specific label is present, you can follow these steps: ### Step 1: Set up the Trigger 1. Search for the Linear (OAuth) app in the trigger menu. 2. Select the “New Updated Issue (Instant)” trigger. 3. Connect your Linear (OAuth) account. 4. Select one or more Team IDs or pass an array of strings from a previous step. 5. Follow the instructions on the trigger configuration screen. You may need to generate a test event from Linear (OAuth) to get real data to test your workflow. ### Step 2: Add a Filter Step 1. Search for the Filter app from the step menu. 2. Select the “Continue execution if a condition Is met” action. 3. Connect your Filter account. 4. Select an Initial value: This should be the list of labels from the Linear ticket. You can access this from the trigger step, e.g., steps.trigger.event.labels. 5. Select a Condition: Check if the specific label you are interested in is present in the list of labels. You can use a condition like steps.trigger.event.labels.includes("specific-label"). 6. Test the action to ensure it works as expected. ### Step 3: Create a New Ticket on a Different Linear Team Board 1. Add a new action step to create a ticket in Linear. 2. Search for the Linear (OAuth) app in the action menu. 3. Select the appropriate action to create a new ticket. 4. Connect your Linear (OAuth) account. 5. Configure the action with the necessary details for the new ticket, such as the team board, title, description, etc. 6. Test the action to ensure it creates the ticket as expected. ### Example Code for the Filter Step Here’s an example of how you might set up the filter step in code: ```
export default defineComponent({ async run({ steps, $ }) { const labels = steps.trigger.event.labels; const specificLabel = “specific-label”; // Replace with your specific label if (!labels.includes(specificLabel)) { $.flow.exit(“The specific label is not present. Ending workflow.”); } else { $.export(“$summary”, “The specific label is present. Continuing workflow.”); } }, });

I need to create a workflow where the trigger is when a Linear ticket has an updated label. I want the trigger to kick off when a specific label “Needs blog post” was added to the Linear ticket. Then, the next action is the workflow will create a new ticket on a different linear team board. I need to know to set up the filter in scenarios that a linear tickets has multiple labels. I need the workflow to only continue if the label “Needs blog post” is added to a linear ticket exists. I need a filtering step that will check if the Linear ticket has the specific label so the workflow can continue

To create a workflow in Pipedream that triggers when a Linear ticket has an updated label, and specifically continues only if the label “Needs blog post” is added, you can follow these steps: ### Step 1: Set Up the Trigger 1. Search for the Linear (OAuth) app in the trigger menu. 2. Select the “New Updated Issue (Instant)” trigger. 3. Connect your Linear (OAuth) account. 4. Select the relevant Team IDs or pass an array of strings from a previous step. 5. Follow the instructions on the trigger configuration screen. You may need to generate a test event from Linear to get real data to test your workflow. ### Step 2: Add a Filter Step 1. Search for the Filter app from the step menu. 2. Select the “Continue execution if a condition is met” action. 3. Connect your Filter account. 4. Set the Initial value to the list of labels from the Linear ticket. You can access this from the trigger step data, for example, steps.trigger.event.labels. 5. Set the Condition to check if the “Needs blog post” label is present in the list. You can use a condition like labels.includes("Needs blog post"). ### Step 3: Create a New Ticket on a Different Linear Team Board 1. Add a new action step to create a ticket in Linear. 2. Search for the Linear (OAuth) app from the action menu. 3. Select the appropriate action to create a new ticket. 4. Connect your Linear (OAuth) account. 5. Configure the action with the necessary details for the new ticket, such as the team board ID, title, and any other required fields. Here’s a sample code snippet for the filter step using JavaScript: ```
export default defineComponent({ async run({ steps, $ }) { const labels = steps.trigger.event.labels; if (!labels.includes(“Needs blog post”)) { $.flow.exit(“The label ‘Needs blog post’ was not added. Ending workflow.”); } $.export(“$summary”, “The label ‘Needs blog post’ was added. Continuing workflow.”); }, });