Skip to content

$p.siteId

Overview

Gets the site ID.

Syntax

$p.siteId(siteTitle)

Parameters

Parameter name Type Required Description
siteTitle string The title of the site. Can be omitted.

Return Value

If the argument is omitted, returns the site ID of the site (folder, table, Wiki, dashboard, etc.) where this method is executed.

If the argument is specified, returns the site ID of the site whose title matches, from among the site where this method is executed and the sites linked to it. If no site matches, returns undefined.

Usage Examples

When executed on the site "WBS" whose site ID is 100

// When the argument is omitted
$p.siteId(); // 100

// When the argument is specified (the title matches)
$p.siteId('WBS'); // 100

// When the argument is specified (no site has a matching title)
$p.siteId('Issue management'); // undefined

Code Samples

Note

Modify 【 ... 】 in the code as necessary.

1. Conditional Duplicate Check by the Combination of Title, Target Date, and Creator

This sample is in the sample code of "$p.events.before_validate".