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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.