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.
Hi Robert,
Thank you for your feedback. I included the code you kindly suggested as follows but I am getting an error that the expression is invalid when creating an issue.
Reference to your second suggestion, how would the user invokes the Form?
Thank you again for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Derek,
Thank you for your feedback.
How would you invoke a Form through JIRA?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marco Scicluna , it looks like the Validator you picked was the "Date Compare", you should swap to use the "Regular Expression" validator instead.
As for @Derek Fields _RightStar_ 's recommendation, you can instead use the JSM Forms feature as part of Jira Service Management. You should see the option in the Project Settings, listed as "Forms". Here's a quick guide written by Atlassian: https://support.atlassian.com/jira-service-management-cloud/docs/create-or-edit-a-form/
One thing I would recommend is ensuring that you link any of the Forms input fields to regular Jira Custom Fields, so that the inputed data is searchable via Jira Issue Search.
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.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.