Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to validate a checkbox?

I have two single select fields in my project:

Field1 is Signature: Signed, Not Signed (its values)

Field2 is Category: Revex, Capex (its values)

 

I have a Documents checkbox with four options:

1. invoices attached

2. Approval mail attached (for not signed)

3. Revex docs attached

4. Capex docs attached

 

On Create Issue, I want the checkbox validation to be as:

If Signature field is Not Signed, then the user must tick the option 2 of checkbox

If Category field is Revex, then the user must tick the option 3 of checkbox

If Category field is Capex, then the user must tick the option 4 of checkbox

The user must always tick the option 1

 

How can I achieve this using JSU? 

2 answers

1 accepted

0 votes
Answer accepted

I was able to achieve the validation as mentioned in the question using a ScriptRunner Build In validators. I used Simple Scripted Validator for each of the conditions. Examples  were very helpful to get started with. 

If Signature field is Not Signed, then the user must tick the option 2 of checkbox

cfValues['Signature']?.value!= "Not Signed" || cfValues['Documents']*.value.contains("Approval mail attached (for not signed)") 

Did it similarly for below two conditions:

If Category field is Revex, then the user must tick the option 3 of checkbox

If Category field is Capex, then the user must tick the option 4 of checkbox

The user must always tick the option 1:

cfValues['Documents']*.value.contains("invoices attached") //i.e. option 1

Important Note: The value in contains() should be the exact value of the option. 

Hi @Pranita Warik 

This doesn't work in Jira Cloud. Could you please help me with the script for the cloud instance.

I am trying to add the following validator script to Workflow but getting the following error.

cfValues['Sub-Status']*.value.contains("On hold")

Here 'Sub-Status' is a checkbox field having only 1 value 'On hold' currently.

Error Validator.PNG

Thanks in advance.

Sneha

Hi, @Pranita Warik We'd love to help you with your special use case. Kindly create a ticket here so we could help you configure. Thank you. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.5.1
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

263 views 7 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you