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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,491
Community Members
 
Community Events
184
Community Groups

changing system select field value to set other custom fields as required in jira using behaviour

Edited

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

  • Defect Category
  • Technical Cause Resolution Issue.PNG

 

1 answer

1 accepted

0 votes
Answer accepted
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 13, 2022

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.Resolution-Issue.PNG

Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 13, 2022

@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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events