I have a custom field that is always shown, if it is empty it stated 'The issue has no <custom field>'
Now I have created issues with the custom field and transitioned them from New all the way to Resolved, and it is here that the value of the cf goes to empty... and if I move back to open it remains empty.
Any ideas why this could happen?
What is even more strange is that I have another custom field that is going through the exact same process but it is not being deleted. Where could I look fo what might be happening? I have looked into the cf details and configurations, I have looked into the listeners list, I have looked into the transition actions, the logs, nothing strange
So it turns out the custom field was present in the screen to Resolved, but it only showed the name of the cf and not its value, which is then set to empty. Removing the cf from that screen solved the deletion problem.
Now the question would be why was the cf showing only the name and not the editable part of it in the screen, is there any known case scenario where this happens?
That's not how JIRA behaves, the removal of the values would have gone into the history if it were just a blanking out during the transition.
The reason your field was showing the name is that that is what JIRA does when you put a field on the screen. I suspect the value display and edit is down to your code breaking it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Karolina, Two questions that might help us get a better handle on your problem:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Doug,
1. the type is an implementation of TextArea
2. the issue history doesn't show the custom field being deleted, just the transition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds like a post-function or listener set up to clear the field out on one of the transitions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for your answer.
we have no extra listeners and no extra post functions, I just made sure of that, just the ones marked as 'internal' and the rest are empty lists
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm, ok. How are you doing the "this issue has no <custom field>" thing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In a plugin I created a Context Provider, and asks if the issue has a value or is null.
@Override
public Map getContextMap(ApplicationUser arg0, JiraHelper jiraHelper) {
Map<String, String[]> contextMap = new HashMap<String, String[]>();
Issue currentIssue = (Issue) jiraHelper.getContextParams().get("issue");
String cfValue = (String) currentIssue.getCustomFieldValue(StaticAccessor.getIssueWithCFManager().getCustomField("Custom Field"));
if(cfValue==null || cfValue.isEmpty()){
cfValue = "This issue has no custom field ";
}
contextMap.put("cfValues", cfValue.split("\n"));
return contextMap;
}
This is because we wanted the cf to be shown always, even when it was empty/null
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mmm, well, that rings some alarm bells itself.
Does it work when you remove this hack?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think it is related to the plugin, I have tried running a local JIRA exporting some of the data and the workflow of the real JIRA and the problem does not happen there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I could use a full description of the problem in two scenarios.
First, if you leave the field empty, so that your code adds a display. Specifically
Second, you put some data into it when you create, and run the issue through to where the data vanishes.
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.