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

0 vote

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?

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

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,301 views 14 20
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot