The custom field label is not showing on my issue screen . what is the problem?

srikanth Asoori maringanti December 19, 2012

whenever I created the custom field and assigned some default values it is working properly.

But that custom field is not showing in the issue screen. what is the problem.

thanks in advance.

2 answers

0 votes
Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2012

The reason you are not seeing the custom field column in your Issue Navigator is that since it is constrained either by Issue Type or Context you will only ever see it if all the issues in the view are of the same issue type and that issue type is the one your custom field is configured against.

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2012

i think you cannont edit any template in an OnDemand Installation

srikanth Asoori maringanti December 19, 2012

No I have configured my custom field for all the screens and also for all issue types.But the problem i hope is that velocity templates .But I am new to Jira and I want to know which velocity template will be responsible for showing the custom field on screen.

srikanth Asoori maringanti December 19, 2012

thanks Faysal.

But is there any other issue other than what you have mentioned which makes the customfield not to appear on issue screen

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2012

i don't know of any issue.

usually i create a custom field and select the screen(s) i want it to appear.

you may have to check your project configuration summary what fields/screen scheme is assigned to it.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2012

No. If the field can be seen on creating an issue, then you've got the field configuration and the field context correct, which narrows it down to three possibilities:

  1. As C. Faysal said - you have not got the field on your view screen
  2. You are hiding it with javascript
  3. You have a plugin that is hiding it (not if you're using OnDemand of course)

You also mention velocity templates - does that mean you are NOT using OnDemand? (Please get your tags right if that's the case!) And you are writing a custom field plugin? We really do need to know this sort of thing when you're asking questions. If that's the case, then what does your plugin's velocity say?

srikanth Asoori maringanti December 19, 2012

Hi Nic,

I did not used any java script in my code. My plugin implements SelectCFtype custom field.And I have copied the same velocity templates as SelectCFtype has i;e view-select,edit-select,xml-select.

Thanks .

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2012

I did not used any java script in my code

jscript code can be placed in field discription or as default value....

hmm you have your own plugin in an Ondemand environment?

srikanth Asoori maringanti December 19, 2012

Yes Faysal.

srikanth Asoori maringanti December 19, 2012
private Object getDefaultStatuses(CustomField field) {

		try {
			FieldConfigSchemeManager sm = (FieldConfigSchemeManager) ComponentManager
					.getComponentInstanceOfType(FieldConfigSchemeManager.class);
			long fieldConfigId = ((FieldConfigSchemeImpl) ((List) sm
					.getConfigSchemesForField(field)).get(0)).getId();
			Object list = genericConfigManager.retrieve(
					CustomFieldType.DEFAULT_VALUE_TYPE,
					Long.toString(fieldConfigId));
			return list;
} catch (NullPointerException npe) {
			return new ArrayList<String>();
		}}}
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2012

Ok, so you're writing a plugin.

Are there any errors in the log when you view an issue that should have your field set?

Are you sure data is going into the field and being stored on create? (Because if it's not being stored, then the field won't show up on view because Jira hides empty fields)

What does your view template say? Can you insert some really simple hard-coded text in it and try again and see if your text appears?

Could you show us the segment of atlassian-plugin.xml that points to all the templates? And then check that the templates all match inside your code?

srikanth Asoori maringanti December 19, 2012

Hi Faysal,

This is my code which worked in jira 4.1.2 but it is not worked in jira 4.4.5.

public class DaysInStatusX extends SelectCFType {
private static Logger LOG = Logger.getLogger(DaysInStatusX.class);
public DaysInStatusX(CustomFieldValuePersister valuePersister,
			StringConverter stringConverter, SelectConverter selectConverter,
			OptionsManager optionsManager,
			GenericConfigManager genericConfigManager) {

		super(valuePersister, stringConverter, selectConverter, optionsManager,
				genericConfigManager);
}
@Override
public Map getVelocityParameters(Issue issue, CustomField field,FieldLayoutItem fieldLayoutItem) {
		Map params = super.getVelocityParameters(issue, field, fieldLayoutItem);

		// This method is also called to get the default value

		if (fieldLayoutItem == null) {
			LOG.debug(">> Appfire Custom Field Ext Plugin: In Custom field configuration screen. Show the default statuses");
			params.put("confscreen", true);
			// return params;
		} else
			params.put("confscreen", false);

		params.put("statusList", getAllStatuses());
		Object retList = getDefaultStatuses(field);
		params.put("defaultStatusList", retList);
		params.put("numDays", getIssueCustomFieldValueFromIssue(field, issue));
		return params;
	}

	private Collection getAllStatuses() {
		return getConstantsManager().getStatusObjects();
	}
public Object getIssueCustomFieldValueFromIssue(CustomField field,Issue issue) {

		if (issue == null || (issue.isCreated() == false))
			return null;

		String fieldValue = (String) issue.getCustomFieldValue(field);
		String status = (String) getDefaultStatuses(field);

		if (fieldValue == null || fieldValue.equals(status))
			return null;
		else
			return fieldValue;

	}

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2012

Would you PLEASE stop reposting the same question over and over.

This code is being discussed in more detail over at https://answers.atlassian.com/questions/117052/what-is-the-problem-with-this-code-in-jira-4-4-5-for-select-list-why-the-list-is-always-returning-null-value

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2012

Please see the thread you keep duplicating. I've given you an answer that works for me, and should work for you.

srikanth Asoori maringanti December 19, 2012

Sorry Nic,

But I did not got any answer for my question.what are the modifications I need to be done to the above code so that it will work in 4.4.5.

Thanks in advance.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 19, 2012

Please, stop commenting in the closed thread. It's no good saying "it doesn't work", especially in the wrong place where there's less information.

Comment in the original question, with the detail available for people to read, and tell us what you've done, how you've approached it and explain what you mean by "it doesn't work".

srikanth Asoori maringanti December 19, 2012

Thanks for your patience Nic. But that is also not working for me.

0 votes
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2012

did you check the assigned screen scheme for appearance of that field?

cheers

Suggest an answer

Log in or Sign up to answer