While Issue creation, if the value of a field "Source of change request" = Customer then the field "External Issue ID" should be made mandatory. I tried with behaviours and listens too in Scriptrunner but its getting mandatory field option while submitting state .But i need to get it while creation of issue.
import com.atlassian.jira.component.ComponentAccessor // Get the custom field manager def customFieldManager = ComponentAccessor.getCustomFieldManager() // Get the fields by name def sourceOfChangeRequestField = getFieldByName("Source of Change Request") def externalIssueIdField = getFieldByName("External Issue Id") // Get the current value of "Source of Change Request" def sourceOfChangeRequestValue = sourceOfChangeRequestField.getValue() as String // Check if the "Source of Change Request" is set to "Customer" if (sourceOfChangeRequestValue == "Customer") { // If "External Issue Id" is empty, show an error and prevent submission if (!externalIssueIdField.getValue() || externalIssueIdField.getValue().toString().trim().isEmpty()) { externalIssueIdField.setError("External Issue Id is required when 'Source of Change Request' is set to 'Customer'.") } else { // Clear the error if the field is filled externalIssueIdField.clearError() } } else { // Clear any existing error if "Source of Change Request" is not "Customer" externalIssueIdField.clearError() }
@mummareddy supriya Jira doesn't perform any form of validation until an issue is created, as such, it is not possible to change values / settings automatically during the creation process. In addition, whether a field is mandatory or not is defined by the schema used by the issue and cannot be changed during issue creation.
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.