Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Blocking transition

Anele June 18, 2024

I am writting a validator script that only allows transition when No is chosen but it blocks all transitions including when No is selected

 

 

import com.atlassian.jira.component.ComponentAccessor


def cfManager = ComponentAccessor.getCustomFieldManager()
def issue = issue


def customFieldName = "There are no previous withdrawals loaded for this contract"


def customField = customFieldManager.getCustomFieldObjects(issue).find {
    it.name == customFieldName && it.getCustomFieldType()?.key == "com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons"
}


if (customField) {
    def selectedOption = issue.getCustomFieldValue(customField)
    if (selectedOption?.value = "No") {
        return true
    }
}


1 answer

0 votes
Tinker Fadoua
Community Champion
June 21, 2024

Good Day @Anele 

Can you please take a screenshot of your workflow? Please hide any confidential info if any

Best,

Fadoua 

 

Suggest an answer

Log in or Sign up to answer