How to restore to old option value of custom field?

Hisamitsu Koga December 12, 2016

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
Vasiliy Zverev
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.
December 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

 

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.
December 12, 2016

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.

Hisamitsu Koga December 12, 2016

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? 

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.
December 12, 2016

Correct.

MattS
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.
December 13, 2016

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

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.
December 13, 2016

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events