Template Content
About the template
About ScriptRunner Connect
What is ScriptRunner Connect?
Can I try it out for free?
Yes. ScriptRunner Connect comes with a forever free tier.
Can I customize the integration logic?
Absolutely. The main value proposition of ScriptRunner Connect is that you'll get full access to the code that is powering the integration, which means you can make any changes to the the integration logic yourself.
Can I change the integration to communicate with additional apps?
Yes. Since ScriptRunner Connect specializes in enabling complex integrations, you can easily change the integration logic to connect to as many additional apps as you need, no limitations.
What if I don't feel comfortable making changes to the code?
First you can try out our AI assistant which can help you understand what the code does, and also help you make changes to the code. Alternatively you can hire our professionals to make the changes you need or build new integrations from scratch.
Do I have to host it myself?
No. ScriptRunner Connect is a fully managed SaaS (Software-as-a-Service) product.
What about security?
ScriptRunner Connect is ISO 27001 and SOC 2 certified. Learn more about our security.
You can insert or update an existing item on your main board from an external trigger, such as when a new item is created in another board and it's status is updated.
This helps to start syncing items from other sources into a single monday.com board.
Follow these steps to configure the template with your board:
TARGET_BOARD_ID
- Enter the board ID that you want to upsert items to. PROJECT_STATUS_ID
- Enter the ID of the Status column value to update. LABEL
- Enter the status you want to set for items.Create a new item in a secondary monday.com board.
This template will update the status of all existing items in your main board with the same summary value to Working on it.
If no items exist on your main board with this matching summary, then a new item will be created with a status of Working on it.
You could also modify this script to sync for items when an item is created in another tool like Jira or Service Now.
import Monday from "./api/monday";
import { CreateItemEvent } from '@sr-connect/monday/events';
export default async function({ event }: CreateItemEvent, context: Context): Promise<void> {
if (context.triggerType === 'MANUAL') {
console.error('This script is designed to be triggered externally or manually from the Event Listener. Please consider using Event Listener Test Event Payload if you need to trigger this script manually.');
return;
}
const { TARGET_BOARD_ID, PROJECT_STATUS_ID, LABEL } = context.environment.vars;
// Extract required parameters from the event
const { pulseName, pulseId, boardId } = event;
// Fetch all items from your main board that match the new item summary with their current status
const getItemsFromBoard = await Monday.ItemsPage.getItemsPageByColumnValues({
args: {
board_id: TARGET_BOARD_ID,
// This column searches for a case-insensitive match of the entire name text value.
columns: [{ column_id: "name", column_values: [pulseName] }]
},
fields: {
items: {
fields: {
id: true,
name: true,
column_values: {
fragments: {
StatusValue: {
text: true
}
},
fields: {
id: true
}
}
}
}
}
});
const { items } = getItemsFromBoard.data.items_page_by_column_values;
// Update the status of created item
await Monday.Column.changeMultipleColumnValues({
args: {
board_id: boardId,
item_id: pulseId,
column_values: {
[PROJECT_STATUS_ID]: LABEL
}
},
fields: {
id: true
}
});
// Update the status of matching items
if (items.length) {
for (const item of items) {
const { text } = item.column_values.find(status => status.id === PROJECT_STATUS_ID) as unknown as { id: string, text: string };
text !== LABEL && await Monday.Column.changeMultipleColumnValues({
args: {
board_id: TARGET_BOARD_ID,
item_id: Number(item.id),
column_values: {
[PROJECT_STATUS_ID]: LABEL
}
},
fields: {
id: true
}
});
}
} else {
// Create a new item and set the status
await Monday.Item.createItem({
args: {
board_id: TARGET_BOARD_ID,
item_name: pulseName,
column_values: {
[PROJECT_STATUS_ID]: { label: LABEL }
}
},
fields: {
id: true
}
});
}
}