why is my custom field deleted after moved to 'Resolved'?

Karolina Arancibia Valuskova August 18, 2017

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


 

3 answers

0 votes
Karolina Arancibia Valuskova August 21, 2017

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?

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.
August 21, 2017

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.

0 votes
Doug Swartz
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.
August 18, 2017

Karolina, Two questions that might help us get a better handle on your problem:

  1. What is the type of the custom field? 
  2. Does the issue history show the field being cleared at the time you resolve it?
Karolina Arancibia Valuskova August 18, 2017

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

0 votes
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.
August 18, 2017

Sounds like a post-function or listener set up to clear the field out on one of the transitions.

Karolina Arancibia Valuskova August 18, 2017

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

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.
August 18, 2017

Hmm, ok.  How are you doing the "this issue has no <custom field>" thing?

Karolina Arancibia Valuskova August 18, 2017

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

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.
August 18, 2017

Mmm, well, that rings some alarm bells itself.

Does it work when you remove this hack?

Karolina Arancibia Valuskova August 18, 2017

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.

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.
August 18, 2017

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

  • You always see the display, but there's no data there? 
  • If you disable the add-on, the field hides itself ok?

Second, you put some data into it when you create, and run the issue through to where the data vanishes. 

  • Can you identify when it goes away?  Which change of status?
  • When it goes away, what is the behaviour.  Does the data get emptied out and your plugin replaces it with your text, or does it just vanish completely?
  • What does the history record for *any* changes to the field?

Suggest an answer

Log in or Sign up to answer