You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi All,
I am trying to make a field mandatory based on value in the another field using below code in script runner. But it is not working 100% correctly -
- When i create a JIRA ticket and make the select 1 in the field "Quality Assessment", it doesnt show "Quality Comment" field as mandatory. We have to click on update and again edit the JIRA ticket to see the field "Quality Comment" as mandatory.
- Also it doesnt stop state transition even when the field is made mandatory and not filled.
The only thing it does is that it doesnt allow to edit the JIRA till the time we fill the mandatory field field "Quality Comment".
Based on your script, the values will only take place after an edit which is the expected behavior you have. You'll need to have a line above to check for when field are change on the screen to check against the value. Here's the example line:def sourcefield = getFieldById(getFieldChanged())
Would not recommend using start with 1. If you know the value is 1, would state it with an = statement.
-Ben
Thanks Ben for your response!!
I put the below code in the server side script for a the custom field which is responsible for change in the below "Quality Comment" and it worked.
For only below two options field should display and show as mandatory.
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.