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.
selecting a single value in system select field-"Resolution" have to set multiple custom fields as required..
selecting a single value in custom select fields "Defect Category" have to set multiple system fields as required.. are working but not the vice versa
CustomFields
Hi @Ravi Kanth For setting custom field Defect Category and Technical Cause mandatory based on Resolution system field. For this you have to apply Server side script on Resolution field and apply the following script. Kindly change field id and Resolution name in If/else statement.
hope it works for you!
import com.atlassian.jira.issue.resolution.Resolution
def resolutionField = getFieldById("resolution")
def fixVersionsField = getFieldById("fixVersions")
def defect = getFieldById("customfield_12345")
def technical = getFieldById("customfield_78910")
def resolution = resolutionField.getValue() as Resolution
if (resolution.name == "Fixed") {
fixVersionsField.setRequired(true)
defect.setHidden(false)
technical.setHidden(false)
} else {
fixVersionsField.setRequired(false)
defect.setHidden(false)
technical.setHidden(false)
}
Thanks
V.Y
Hi@Vikrant Yadav ,
Thank u soo much...
the code works but when reverting back the selection to "Please Select.." custom Field still remains as mandatory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ravi Kanth May i know Please Select is a value you added to Resolution field ? If Yes, try to add "Please select.." in else statement.
else if (resolution.name == "Please select.." ) {
defect.setRequired(false)
technical.setHidden(false)
}
Usually Default value comes for mandatory Resolution field.It seems that you added Please Select... value in Resolution.
Let me know, how it works.
Thanks
V.Y
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.