Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

i have one radio button YES/No If i am selected Yes then my checkbox should be mandatory in jira

ssabanam11 July 22, 2022

I have one radio button YES/No If i am selected Yes then my checkbox should be mandatory in Jira

2 answers

1 vote
John Funk
Community Champion
July 23, 2022

Hi @ssabanam11  - Welcome to the Atlassian Community!

The only way I am aware of to do something like this is with the Behaviours add-on by ScriptRunner. 

ssabanam11 July 23, 2022

kindly share the script for check box .

 

Tried it below but not working

 

COTS Dependency   -----It is radio button

System Providing Service --- it is checkbox 

 

Description :- if someone select COTS Dependency Yes then check box field should be checked by user at least one option  during create option 

 

Script.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.onresolve.jira.groovy.user.FormField
import org.apache.log4j.Category

if (cfValues['COTS Dependency'] == 'Yes') {

cfValues['System Providing Service'] !=null
}
else
cfValues['COTS Dependency'] != 'Yes'

0 votes
Rafael Costa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 22, 2022

I don't understand the goal...

ssabanam11 July 23, 2022

kindly share the script for check box .

 

Tried it below but not working

 

COTS Dependency -----It is radio button

System Providing Service --- it is checkbox

 

Description :- if someone select COTS Dependency Yes then check box field should be checked by user at least one option during create option

 

Script.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.onresolve.jira.groovy.user.FormField
import org.apache.log4j.Category

if (cfValues['COTS Dependency'] == 'Yes') {

cfValues['System Providing Service'] !=null
}
else
cfValues['COTS Dependency'] != 'Yes'

Rafael Costa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 25, 2022

If You is using a groovy post function, You could to do it with InvalidInputException class. Below an example if a != b.

import com.opensymphony.workflow.InvalidInputExceptionimport 
if (a != b){
    def error = new InvalidInputException("Error message")
    throw error
}

 

Like ssabanam11 likes this
ssabanam11 August 8, 2022

done

Like Rafael Costa likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events