Execute_AddEntityTag
Description
Adds a tag to the specified entity at runtime. The tag can optionally expire based on an ExpireRule specified in S2. If no ExpireRule is specified, it is treated as AfterMinutes.
Note
Supported ExpireRules:
- AfterMinutes: tag expires after F1 minutes (max 1400 * 7).
- AfterDaysAt: tag expires at a specific time (F2 in hhmm) after F1 days. If the calculated time has already passed that day, it rolls to the next valid day.
- DayOfWeekAt: tag expires at a specific weekday (F1: 0=Monday ~ 6=Sunday) and time (F2 in hhmm). If the specified weekday+time has already passed, it rolls to the following week.
Parameters
| Parameter | Description |
|---|---|
| BaseObject | The entity to which the tag will be added |
| S1 | The tag name to add |
| S2 | ExpireRule: AfterMinutes, AfterDaysAt, or DayOfWeekAt. Defaults to AfterMinutes if omitted |
| F1 | Value determined by ExpireRule (minutes, days, or day-of-week index) |
| F2 | Additional value determined by ExpireRule (time in hhmm format) |
Examples
| Description | BaseObject | Command | S1 | S2 | F1 | F2 |
|---|---|---|---|---|---|---|
| Add tag 'QWE' and keep it for 60 minutes | Self | AddEntityTag | QWE | 60 | ||
| Add tag 'QWE' expiring at 03:00 after 2 days | Self | AddEntityTag | QWE | AfterDaysAt | 2 | 0300 |
| Add tag 'QWE' expiring on Friday at 03:00 | Self | AddEntityTag | QWE | DayOfWeekAt | 4 | 0300 |
Back to Command FinderSearch and filter all 399 Script Execution documents