You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello
I want to check a radio button value with a groovy script.
My radio button custom fiel ID is 15002, can have 3 choose : none, oui, non.
If value is on "yes", I want a true return
Here the script I wrote, but don't work
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_15002")
def value = issue.getCustomFieldValue(customField);
if (value == "oui")
{
return true
}
Any help ?
Hi @cendre Please try below code.
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager()
IssueManager issueManager = ComponentAccessor.issueManager
MutableIssue issue = event.issue as MutableIssue
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_15002")
def value = issue.getCustomFieldValue(customField)
if (value == "oui")
{
return true
}
I try with this code, and it's work
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.Issue
CustomField radioButton = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Configuration ?");
if(radioButton == null)
return false
if(radioButton.getValue(issue).toString().equals("oui"))
return true
else
return false
Thank @Subrat Mishra for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.