Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Migrate Insight objects (multiple) (legacy) custom fields to Insight objects custom fields

This Community post provides a possible workaround to migrate Insight objects (multiple) (legacy) custom fields to Insight objects custom fields.

The Groovy script can be executed, for example from the Insight Script Console

It has been tested in Jira 8x

You should plan a maintenance window when you are migrating the fields in order to have a clean and effective migration without interruptions.

Groovy code example:

import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.event.type.EventDispatchOption;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.web.bean.PagerFilter;

def projectManager = ComponentAccessor.getProjectManager();
def issueManager = ComponentAccessor.getIssueManager();
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
def searchService = ComponentAccessor.getComponentOfType(;
def jqlQueryParser = ComponentAccessor.getComponentOfType(com.atlassian.jira.jql.parser.JqlQueryParser);

def deprecatedInsightCustomFieldId = *****;
def newInsightCustomFieldId = *****;

/* Change the custom field id's accordingly to your environment and the custome fields you want to migrate */
def deprecatedInsightCustomField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(deprecatedInsightCustomFieldId);
def newInsightCustomField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(newInsightCustomFieldId);

def query = jqlQueryParser.parseQuery("cf[" + deprecatedInsightCustomFieldId + "] is not EMPTY");
def searchResults =, query, PagerFilter.getUnlimitedFilter());

log.warn("Issues to be updated: " + searchResults.getTotal());
searchResults.getResults().each { issue ->
MutableIssue mi = (MutableIssue) issueManager.getIssueObject(issue.getId());
def insightObjects = mi.getCustomFieldValue(deprecatedInsightCustomField);
if (insightObjects != null && !insightObjects.isEmpty()) {
mi.setCustomFieldValue(newInsightCustomField, insightObjects);
ComponentAccessor.getIssueManager().updateIssue(currentUser, mi, EventDispatchOption.DO_NOT_DISPATCH, false);

log.warn("Changed issue: " + mi + ", set new custom field with values: " + insightObjects);



We migrated from "MigrateSourceMultiple" custom field to "Insight New"

Screenshot 2022-02-22 at 16.15.31.png



Log in or Sign up to comment
AUG Leaders

Atlassian Community Events