Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

JSM - change a custom text field to required based on custom field value (single select)

Need this to work on customer request type, creation.

I have two fields on the customer request type

"Is a Supervisor?" Select List (single choice)

"Client Name " Text field (single line)

If Is a Supervisor? = N the Client Name field is required, otherwise it is an optional field

Using Scriptrunner behaviour

I create the following, and it requires the field, but it requires it all the time.  Appreciate any help.

Mapped to specific JSM project and Customer Type
Guide workflow is set

INitialiser:

import com.atlassian.jira.issue.resolution.Resolution

def dropDownCF = getFieldByName('Is a Supervisor?')
def requiredCF = getFieldByName('Client Name')
def valueCF = getFieldByName('Is a Supervisor?').value

if (valueCF == "No") {
requiredCF.setRequired(true);
} else {
requiredCF.setRequired(false);
}

Data Center
JIRA 8.20.1
JSM 4.20.1
ScriptRunner 6.39.0

1 answer

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 12, 2023

HI Deborah,

You will need an add-on like the ScriptRunner Behaviours app. 

Thank you, i am using scriptrunner

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 13, 2023

Not just ScriptRunner, but the Behaviours app. 

I am not using the cloud version - i am on the data center version.  sorry if i did not tag this correctly.

Like John Funk likes this
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Feb 14, 2023

Oh - sorry, I missed that. I am not sure if Behaviours is included in the DC version of ScriptRunner or if it a separate app. But you will need to solve with the Behaviours tool. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events