Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.2 KB
Raw Blame
import { Property, createAction } from '@activepieces/pieces-framework';
import { mondayAuth } from '../auth';
import { makeClient, mondayCommon } from '../common';
import { updateItemNameActionOutputSchema } from '../output-schemas';

export const updateItemNameAction = createAction({
  auth: mondayAuth,
  name: 'monday_update_item_name',
  classification: 'WRITE',
  displayName: 'Update Item Name',
  description: 'Updates an item name.',
  audience: 'human',
  aiMetadata: { description: 'Renames an existing monday.com item identified by board and item id. Use to change an item\'s title. Idempotent: re-applying the same name leaves the item unchanged.', idempotent: true },
  outputSchema: updateItemNameActionOutputSchema,
  props: {
    workspace_id: mondayCommon.workspace_id(true),
    board_id: mondayCommon.board_id(true),
    item_id: mondayCommon.item_id(true),
    name: Property.ShortText({
      displayName: 'New Item name',
      required: true,
    }),
  },
  async run(context) {
    const { board_id, item_id, name } = context.propsValue;

    const client = makeClient(context.auth);
    return await client.updateItem({
      boardId: board_id,
      itemId: item_id,
      columnValues: JSON.stringify({ name: name }),
    });
  },
});