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

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

This widget could not be displayed.

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

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

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

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

Mmm, well, that rings some alarm bells itself.

Does it work when you remove this hack?

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.

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?
This widget could not be displayed.

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?

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

This widget could not be displayed.

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.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

215 views 3 0
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you