I wanted to restrict visibility for a change made after stream creation/edit, so this stream change is not visible by unwanted users with 'p4 changes' command.
I used a 'form-commit stream' trigger to update the change type to restricted, however the %change% variable is not expanded at trigger. According to documentation %change% should be expanded for form-commit trigger.
set_restricted_stream form-commit stream "J:\apps\triggers_batch\set_restricted_stream.bat %change%"
CD /D J:\apps\triggers_batch @SET P4PORT=**** @SET P4USER=**** @SET P4PASSWD=**** @SET P4CLIENT=**** p4 change -t restricted -f %1
Error returned at stream creation/modification:
'set_restricted_stream' validation failed: F:\P42\Server>CD /D J:\apps\triggers_batch J:\apps\triggers_batch>p4 change -t restricted -f %change% Invalid changelist number '%change%'.
As you see %change% is not expanded. Other variables i.e. %client% works fine.
Perforce server is running on Windows:
Server version: P4D/NTX64/2019.2/1897966 (2019/12/16)
Any suggestions, help what could be wrong? Is there a better way to do it?