On the current issue you need to iterate over all custom fields and check if there is the custom fiel of type: "com.pyxis.greenhopper.jira:gh-sprint".
If that customfield exists, you need to do something like this:
CustomField customField Issue issue.... ... Object cfValue = customField.getValue(issue); final List sprintList = (List) cfValue; // Get the first one if (sprintList != null && sprintList.size() > 0) { final Method ghSprintMethod = printList.get(0).getClass().getMethod("getName", null); final Object resultValue = ghSprintMethod.invoke(sprintList.get(0), null); if (resultValue instanceof String) { cfValue = (String) resultValue; } }
I hope this helps you.
Cheers,
RMRodrigues.
Your custom field was created by a plugin or from Administratin->Issues-> custom fields?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK. I don't know if it's possible via configuration. Maybe you need to install a plugin that allows you to do that. Cheers, RMRodrigues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes Rui I tried with Behaviours plugin using above code i posted. the problem is my code works fine with other custom fields and no result with using the Sprint field. it seems my code unable to read the value of the Sprint. anyway thanks for your valuable time consumed.probably i need to see this thing in different angle. Cheers..:)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add a tag of that plugin on your question in order to get more help. "addon-com.onresolve.jira.plugin.behaviours"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rui yes,I just want to check the sprint field null or not i have used Behaviours plugin and tried following script FormField sprint = getFieldByName("Sprint") FormField productArea = getFieldByName("Product Area") String sprintValue = (String) sprint.getValue() if(sprintValue!= null){ productArea.setReadOnly(true) } but not able to get any result.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Are you talking about getting the sprint name from Java code?
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.