How to restore to old option value of custom field?

Let me assume there is a custom field (select list (single choice)). There are two contexts in the custom field.

One project uses one context in this custom field and another project uses in another context in this custom field. One project has some existing tickets with this custom field and change the context to another context

in the custom field. This means option value in current existing tickets will be changed to another value. Right?

I would like to revert to original option value in current existing tickets. How can I do this? Please let me know.

2 answers

0 votes

If a value is not valid for a field, you can't have it in that field, it needs to be changed to a valid one.

The best you can do is create a copy of the value that is becoming invalid, make the change, and then make the new invalid value "archived" in the options so that it can't be chosen again.

If you've already made the change and flipped over the invalid options to something, then you'll need to add the duplicate option, get a list of the ones that have been updated, and bulk-edit them to take up the new (but archived) option.

Already deleted one context which current existing tickets with old option value. In DB those tickets

have old option value and if uses same custom field / option name to search tickets, but current option value is different from old option value, so we can't search tickets as our expectations I guess. Right? 

Correct.

Doesn't ScriptRunner have a builtin script to help with this case?

Not specifically, but the bulk import and update en-masse might be able to do it.  A self-written console script could do it too of course.

0 votes
Vasiliy Zverev Community Champion Dec 13, 2016

Here is action to restore options:

  1. Restore JIRA from xml backup on test instance
  2. select all issues where this field is not empty: "field name" is not emty
  3. Do bulk update for each option on product instance
    1. Select issues with JQL: issues in (list on issue keis from test instance)
    2. do bulk update

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

63 views 3 2
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