Client action lock until question

I am trying to build a task which will prompt for how many hours to lock a client for using the “action lock until”

By default clients are unlocked

I have a task:

action parameter query “_hours_wait” with description "Lock the system for how many hours [hh]"
action lock until “{now + (parameter “_hours_wait”*hours)}” on “{parameter “action issue date” of action}” for client

I have a syntax error in the lock syntax, any help would be appreciated.
Command failed (Relevance substitution failed) action lock until “{now + (parameter “_hours_wait”*hours)}” on “{parameter “action issue date” of action}” for client (action:118186)

The goal is to support scheduling the task to run starting at a particular day/time and the task would handle how long the lock needed to be applied and unlock on its own.

I have done this with separate scheduled tasks to lock, and unlock but inevitably systems are unlocked that should not be, and some are left locked.

Thank you

I can’t test at the moment, but it’s likely the parameter is evaluating as a string and you need it to be integer. Try

action lock until "{now + (parameter "_hours_wait" as integer * hours)}" on "{parameter "action issue date" of action}" for client

edit: fixed smartquotes

Tried your update:

action lock until “{now + (parameter “_hours_wait” as integer * hours)}” on “{parameter “action issue date” of action}” for client

Command failed (Relevance substitution failed) action lock until “{now + (parameter “_hours_wait” as integer * hours)}” on “{parameter “action issue date” of action}” for client (action:118187)

did i get the quotes correct?

It seems there are problems casting ‘now’; I need a double cast to make it working.
Try:

action lock until “{(now as string) as time + (parameter “_hours_wait” as integer) * hour}” “{parameter “action issue date” of action}” for client

Moreover, the action lock until syntax does not want the ‘on’ between the dates.

Not quite - i am using Bigfix server 9.5.14 and client 9.5.14 on Windows 2016 (if it helps)

Command succeeded action parameter query “_hours_wait” with description “Lock the system for how many hours [hh]” (action:118195)

Command failed (Relevance substitution failed) action lock until “{(now as string) as time + (parameter “_hours_wait” as integer) * hour}” “{parameter “action issue date” of action}” for client (action:118195)
At 13:42:46 -0400 -

I went so far as copying the syntax from the man page directly and it failed the too

action lock until “{now + 3*days}” “{now}”

Command failed (Relevance substitution failed) action lock until “{now + 3*days}” “{now}” (action:118191)

Does any one have a task with this command functioning as an example?

I have a 9.5.14 on suse.
The example in the doc fails also in my env, apparently for the final ‘s’ in ‘day(s)’. It works removing the ‘s’:

action lock until "{now + 3*day}" "{now}"

I tried again also the entire command; probably the problem in my env was hour(s); it could also be that when copying the text from the forum some character remained dirty. Try to copy and paste this one:

action lock until "{now + (parameter "_hours_wait" as integer) * hour}" "{parameter "action issue date" of action}" for client

Check that the " (quotes) are not changed in " or " (open-close quotes) during paste.

Thank you - it as a combination of quotes open/close and ‘s’

Works great.