Form validation

Hi guyz,

Please help me,

If there is any possibility to perform the form validation in JIRA OnDemand?

Thanks in advance,

Karthik A.

5 answers

1 accepted

This widget could not be displayed.

then you have to create your own validator using atlassian Connect for ondemand jira

check this

https://developer.atlassian.com/display/AC/Atlassian+Connect

This widget could not be displayed.

In create issue form, i want to add the form validation in Ondemand JIRA?

import java.util.regex.Pattern;

import com.opensymphony.workflow.InvalidInputException;

import com.atlassian.jira.component.ComponentAccessor;

import com.atlassian.jira.issue.CustomFieldManager;

InvalidInputException e=new InvalidInputException();

ComponentAccessor comAcc =new ComponentAccessor();

CustomFieldManager cfm =  comAcc.getCustomFieldManager();

Object PhoneNumber = issue.getCustomFieldValue(cfm.getCustomFieldObjectByName("Phone Number"));

Pattern.matches("{your phone number regular expression}",PhoneNumber.toString()) == false)

{

e.addError(cfm.getCustomFieldObjectByName("Phone Number").getId(),"Phone number should be 10 digits"

}

The below link show how to add regular expression for 10 digit phone number

http://www.w3resource.com/javascript/form/phone-no-validation.php

This widget could not be displayed.

which form?

Is it workflow transition form, editing issue form, or any other form?

This widget could not be displayed.

you can configure field required validator from JSU Plugin which is preinstalled on ondemand jira

check abt validator

https://jsutil.atlassian.net/wiki/display/JSUTIL/JIRA+Suite+Utilities+Workflow+Validators#JIRASuiteUtilitiesWorkflowValidators-FieldsRequiredValidator

check this doc for more information on configuration of validator

https://confluence.atlassian.com/display/JIRA/Advanced+workflow+configuration#Advancedworkflowconfiguration-validatorAddingavalidator

if you want field required on create screen then you can make it required in the field configuration for the issue type/project

check this

https://confluence.atlassian.com/display/JIRA051/Specifying+Field+Behaviour#SpecifyingFieldBehaviour-Makingafieldrequiredoroptional

Hi prasad,

How to configure these one into ondemand JIRA?

got to administartion page

select Issues ---->workflows

select the workflow on which you want to do validation

click on edit option on right side of the workflow(it will create draft workflow)

click on new/open step name

click on create step

then click on validators tab

click on add link which is under validator tab

select the field required validator radio button then it will display the window and you need to choose the field which you need to validate

once it is completed then publish draft

Note:all the above steps are valid if you oopen workflow as in text mode

Hi Prasad,

I need to validate the text in the text box field using regex.for eg the mobile number field must be contains only the 10 digit. if we are giving less than 10 digit, it will show the message like "Reqiuired 10 digit". Any thing possible like that in onDemand JIRA.

This widget could not be displayed.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

565 views 25 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you