It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Retrieve a radio button value

Christophe Leite Aug 20, 2013

Hello,

I've got a field named "Asked" with 2 possible answers (Yes or No) in my issue.

In my workflow, I would like to retrieve the field value.

How can I do that ? I've tried
cfValues['Asked'].getValue() == 'Yes' but that doesn't work... :-(

Thanks,

Christophe

2 answers

1 accepted

1 vote
Answer accepted
Rambanam Prasad Aug 20, 2013

the following code i have usedto get radio button value

CustomFieldManager cfm = ComponentManager.getCustomFieldManager()
CustomField asked = cfm.getCustomFieldObjectByName("Asked")
Option option=(Option)issue.getCustomFieldValue(asked);
if (option.getValue().equals("Yes")) {
// remaining code here
}

if you are doing it by Behaviour plugin then try with this code

FormField asked = getFieldByName ("Asked")
String value = asked.getValue()
if (value == "Yes") {
// remaining code here
}

check this document to get some sample codes

https://jamieechlin.atlassian.net/wiki/display/JBHV/Miscellaneous+Behaviours+Examples

Christophe Leite Aug 21, 2013

So, in my case, should it be cfValues['Asked'].option.getValue().equals("Yes") ?

Rambanam Prasad Aug 21, 2013

something like this

cfValues['Asked'].getValue().equals("Yes")

can you check what value it will return the following code

cfValues['Asked'].getValue()

Rambanam Prasad Aug 21, 2013

i have update my answer try with that code it should work!!

0 votes
Christophe Leite Aug 21, 2013

How can I display tis value in a message box ?

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Jira

Try Jira Cloud for Outlook: Organize your work without leaving your inbox

Hi Atlassian community, My name is Max and I work on the product integration team at Atlassian. I am pleased to announce the early access program for the Jira Cloud add-in for Outlook. This add-in...

2,325 views 6 15
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you