Create Labels: label

Use label to create or update a view or revision label. A view label can be designated as a build label. By default, view labels are automatically applied to every folder, file, change request, requirement, topic, and task in the view. By default, revision labels are not applied to any items.

You can use apply-label to apply labels created with label to specified files. You can also use the label option (-vl) in ci to attach your new label to files as you check them in.

Syntax

The syntax for this command is:

stcmd{Ex} label -p "projectSpecifier" -nl "labelName" [-vl "labelName" |
-vd "asOfDate" | -vp stateName] [-d "description"] [-b | -r] [-f] [-u] 
[–pattern “date-pattern”] [-ps promotionStateName ]

Parameters

For information about the command parameters, refer to Operation Parameters.

In addition:

Parameter

Description

-nl Specifies the new label’s name. If not found, a new label will be created. If found, the existing label description will be updated and the label will be marked frozen or unlocked.
-b Specifies that the new label is a build label. Without either-b or -r, the label is a view label. View labels (and a build label is a special type of view label) are immediately and automatically applied to every folder, file, change request, task, and topic in the view.
-r Specifies that the new label is a revision label. You can use the new label to label files that you check in. This command does not attach the new label to any items unless you create the label by copying an existing revision label that is attached to one or more items. See the -vl option.
-f Creates the new label as a frozen label or updates an existing label and marks it as a frozen label.
-u Creates the new label as an unlocked label or updates an existing frozen label and marks it unlocked.
-ps

When -ps is specified, the label is assigned to the promotion state specified by -ps. If the label name does not exist, then a new label is created following existing rules. If the label name already exists, then it is simply assigned to the promotion state.

Note: If none of -vd, -vl or -vp are specified, then the created label is based on the current server time.

Example

The following example uses label to create a new build label named Beta for the StarDraw view of the StarDraw project.

Use the -p with label or the stateful set command to set the context of the project/view/parent folder.

stcmd label -nl "Beta" -b