How can I create a validation in the Create screen to restrict users to enter a time between 09:00 and 17:00. I wish to prompt the user if the input is outside of this time window and the issue is not created.
Thank you.
Hi @Marco Scicluna , this should be possible with the "Regular Expression Check" validator available in Jira Cloud by default.
This will require you to use a plain text custom field, and a regular expression that reflects the range you're looking to validate.
This regex should work, but please confirm with your own testing:
(([9]|1[0-6])\:[0-5]{1}[0-9]{1})|(17:00)
To break down the regex, largely it's split into two sections:
(([9]|1[0-6])\:([0-5]{1}[0-9]{1}))
and
|(17:00)
The first section has the following goals:
The second section has the following goal:
You should be able to add this validator to the create transition, and this will prevent the issue from being created if this fails.
Hope that helps,
Robert
@Marco Scicluna @Robert DaSilva - This will validate the date entry, but the user won't receive a prompt that the entry is invalid before the issue is created.
The easiest way to validate user input before they submit the request is to use a Form rather than the out-of-the-box Request format. You can set the validation regex that @Robert DaSilva suggested in the field on that form.
Alternatively, you could use an App such as Extension for Jira Service Management or Behaviours - ScriptRunner for Jira Cloud. These will both support pre-submit validators on regular JSM portal screens.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.